summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/patches/libmng-1.0.10-endless-loop.patch
blob: 31f0474e6bfc70cec74be8272c3399c8cd32ab49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- libmng_data.h.orig	2007-04-20 10:41:58.000000000 +0200
+++ libmng_data.h	2007-07-14 00:00:00.000000000 +0200
@@ -658,6 +658,9 @@
            mng_int32         iFrameclipb;
 
            mng_uint32        iNextdelay;         /* delay *after* next image */
+
+           mng_bool          bForcedelay;
+           mng_uint32        iAccumdelay;
 #endif
 
 #ifndef MNG_SKIPCHUNK_SHOW
--- libmng_display.c.orig	2007-04-20 10:41:58.000000000 +0200
+++ libmng_display.c	2007-07-14 00:00:00.000000000 +0200
@@ -384,8 +384,9 @@
 
   {
 #ifndef MNG_SKIPCHUNK_FRAM
-    if (pData->iFramedelay > 0)        /* real delay ? */
+    if (pData->iFramedelay > 0 || pData->bForcedelay) /* real delay ? */
     {                                  /* let the app refresh first ? */
+      pData->bForcedelay = MNG_FALSE;
       if ((pData->bRunning) && (!pData->bSkipping) &&
           (pData->iUpdatetop < pData->iUpdatebottom) && (pData->iUpdateleft < pData->iUpdateright))
         if (!pData->fRefresh (((mng_handle)pData),
@@ -455,6 +456,7 @@
       pData->iFrametime = pData->iFrametime + iWaitfor;
                                        /* setup for next delay */
     pData->iFramedelay = pData->iNextdelay;
+    pData->iAccumdelay += pData->iFramedelay;
 #endif
   }
 
@@ -3340,6 +3342,9 @@
   MNG_TRACE (pData, MNG_FN_PROCESS_DISPLAY_MEND, MNG_LC_START);
 #endif
 
+  pData->bForcedelay = pData->iAccumdelay ? MNG_FALSE : MNG_TRUE;
+  pData->iAccumdelay = 0;
+
 #ifdef MNG_SUPPORT_DYNAMICMNG
   if (pData->bStopafterseek)           /* need to stop after this ? */
   {
--- libmng_hlapi.c.orig	2007-07-06 18:23:04.000000000 +0200
+++ libmng_hlapi.c	2007-07-14 00:00:00.000000000 +0200
@@ -446,6 +446,9 @@
   pData->iFrameclipb           = 0;
 
   pData->iNextdelay            = 1;
+
+  pData->bForcedelay           = MNG_FALSE;
+  pData->iAccumdelay           = 0;
 #endif
 
 #ifndef MNG_SKIPCHUNK_SHOW
@@ -1737,6 +1740,9 @@
   pData->iFrameclipb           = 0;
 
   pData->iNextdelay            = 1;
+
+  pData->bForcedelay           = MNG_FALSE;
+  pData->iAccumdelay           = 0;
 #endif
 
 #ifndef MNG_SKIPCHUNK_SHOW