Changes of Revision 45

avidemux3.changes Changed
x
 
1
@@ -1,4 +1,15 @@
2
 -------------------------------------------------------------------
3
+Fri Mar 22 22:41:51 UTC 2019 - enzokiel@kabelmail.de
4
+
5
+- Update to version 2.7.3
6
+  + Vapoursynth is now dynamically loaded to avoid error popup
7
+  + ASF/WMV demuxer fix
8
+  + BMP decoder fix
9
+  + Re-enabled PNG decoder
10
+  + Basic save current state when crashing
11
+  + Misc small improvements
12
+
13
+-------------------------------------------------------------------
14
 Sun Mar 17 01:39:22 UTC 2019 - enzokiel@kabelmail.de
15
 
16
 - Update to version 2.7.2
17
avidemux3.spec Changed
10
 
1
@@ -22,7 +22,7 @@
2
 
3
 Name:           avidemux3
4
 Summary:        Graphical video editing and transcoding tool
5
-Version:        2.7.2
6
+Version:        2.7.3
7
 Release:        1
8
 Url:            http://avidemux.sourceforge.net/
9
 ExclusiveArch:  %ix86 x86_64
10
avidemux_2.7.2.tar.gz/avidemux/common/ADM_audioFilter/src/audiofilter_bridge.cpp -> avidemux_2.7.3.tar.gz/avidemux/common/ADM_audioFilter/src/audiofilter_bridge.cpp Changed
9
 
1
@@ -156,7 +156,6 @@
2
     {
3
       // don't ask too much front.
4
       asked = (3*AUD_PROCESS_BUFFER_SIZE)/4-_tail;
5
-      asked/=_wavHeader.channels; // float->samples
6
       if(false==_incoming->getPCMPacket(_incomingBuffer.at(_tail), asked, &got,&dts))
7
       {
8
           got=0;
9
avidemux_2.7.2.tar.gz/avidemux/common/ADM_editor/src/ADM_edit.cpp -> avidemux_2.7.3.tar.gz/avidemux/common/ADM_editor/src/ADM_edit.cpp Changed
22
 
1
@@ -437,7 +437,7 @@
2
         {
3
             printf("[Editor] B- frame possible with that codec \n");
4
 #define FCC_MATCHES(x) fourCC::check(info.fcc,(uint8_t *)x)
5
-            if(isMpeg4Compatible(info.fcc) || isMpeg12Compatible(info.fcc) || isVC1Compatible(info.fcc) || FCC_MATCHES("WMV3"))
6
+            if(isMpeg4Compatible(info.fcc) || isMpeg12Compatible(info.fcc) || FCC_MATCHES("VC1 ") || FCC_MATCHES("WMV3"))
7
             {
8
                 ADM_info("[Editor] It is mpeg4-SP/ASP, try to guess all PTS\n");
9
                 uint64_t delay;
10
@@ -464,9 +464,9 @@
11
         }
12
      }
13
     int lastVideo=_segments.getNbSegments();
14
-    if(lastVideo && isH264Compatible(info.fcc))
15
+    if(lastVideo && (isH264Compatible(info.fcc) || FCC_MATCHES("WVC1")))
16
     {
17
-        ADM_info("H264 in mp4 sometimes has invalid timestamps which confuse avidemux, checking\n");
18
+        ADM_info("%s sometimes has invalid timestamps which confuse avidemux, checking\n",fourCC::tostring(info.fcc));
19
         checkForValidPts(_segments.getSegment(lastVideo-1)); 
20
     }
21
     if(true==checkForDoubledFps( video._aviheader,video.timeIncrementInUs))
22
avidemux_2.7.2.tar.gz/avidemux/common/ADM_editor/src/ADM_segment.cpp -> avidemux_2.7.3.tar.gz/avidemux/common/ADM_editor/src/ADM_segment.cpp Changed
41
 
1
@@ -124,8 +124,8 @@
2
   ADM_info("Original frame increment %s = %" PRIu64" us\n",ADM_us2plain(ref->timeIncrementInUs),ref->timeIncrementInUs);
3
   uint64_t minDelta=100000;
4
   uint64_t maxDelta=0;
5
-  int fmin,fmax;
6
-  for (int frame=0; frame<info.nb_frames; frame++)
7
+  uint32_t fmin=0,fmax=0;
8
+  for (uint32_t frame=0; frame<info.nb_frames; frame++)
9
   {
10
       if (ref->_aviheader->getPtsDts(frame,&pts,&dts) && dts!=ADM_NO_PTS && dts!=0)
11
       {
12
@@ -143,9 +143,14 @@
13
           firstNonZeroDtsFrame=frame;
14
       }
15
   }
16
-  ADM_info("min increment %s = %" PRIu64" us for frame %d\n",ADM_us2plain(minDelta),minDelta,fmin);
17
-  ADM_info("max increment %s = %" PRIu64" us for frame %d\n",ADM_us2plain(maxDelta),maxDelta,fmax);
18
-  
19
+  if(maxDelta>=minDelta)
20
+  {
21
+      ADM_info("min increment %s = %" PRIu64" us for frame %d\n",ADM_us2plain(minDelta),minDelta,fmin);
22
+      ADM_info("max increment %s = %" PRIu64" us for frame %d\n",ADM_us2plain(maxDelta),maxDelta,fmax);
23
+  }else
24
+  {
25
+      ADM_warning("DTS missing, cannot probe time increment.\n");
26
+  }
27
   //if (minDelta==ref->timeIncrementInUs*2)
28
               //ref->timeIncrementInUs=minDelta;
29
 
30
@@ -176,7 +181,9 @@
31
         else ADM_info("The first frame DTS = %" PRIu64" ms\n",dts/1000);
32
         if(pts!=ADM_NO_PTS &&pts)
33
         {
34
-            ADM_warning("The first frame has a PTS >0, adjusting to %" PRIu64" ms\n",pts/1000);
35
+            ADM_warning("The first frame has a PTS > 0, adjusting to %" PRIu64" %s\n",
36
+                (pts>=1000)? pts/1000 : pts,
37
+                (pts>=1000)? "ms" : "us");
38
             ref->firstFramePts=pts;
39
 #ifdef ADM_ZERO_OFFSET
40
             seg._refStartTimeUs=pts;
41
avidemux_2.7.2.tar.gz/avidemux/common/ADM_editor/src/utils/ADM_edCheckForInvalidPts.cpp -> avidemux_2.7.3.tar.gz/avidemux/common/ADM_editor/src/utils/ADM_edCheckForInvalidPts.cpp Changed
25
 
1
@@ -78,6 +78,23 @@
2
         ADM_info("No B-frames and no PTS, setting PTS equal DTS\n");
3
         return setPtsEqualDts(hdr,inc);
4
     }
5
+    // check whether DTS are completely missing, ignore the first frame
6
+    bool noDts=true;
7
+    for(uint32_t i=1;i<totalFrames;i++)
8
+    {
9
+        uint64_t pts,dts;
10
+        hdr->getPtsDts(i,&pts,&dts);
11
+        if(dts!=ADM_NO_PTS)
12
+        {
13
+            noDts=false;
14
+            break;
15
+        }
16
+    }
17
+    if(!stats.nbBFrames && !stats.nbPtsgoingBack && hdr->providePts() && noDts)
18
+    {
19
+        ADM_info("No B-frames and no DTS, setting DTS equal PTS\n");
20
+        return setPtsEqualDts(hdr,inc);
21
+    }
22
 
23
     if(stats.nbPtsgoingBack>1 || (stats.nbBFrames && hdr->providePts()==false))
24
     {
25
avidemux_2.7.2.tar.gz/avidemux/qt4/xdg_data/org.avidemux.Avidemux.appdata.xml.in -> avidemux_2.7.3.tar.gz/avidemux/qt4/xdg_data/org.avidemux.Avidemux.appdata.xml.in Changed
9
 
1
@@ -29,6 +29,6 @@
2
     </screenshots>
3
     <content_rating type="oars-1.1"/>
4
     <releases>
5
-        <release version="${AVIDEMUX_VERSION}" date="${BUILD_DATE}"/>
6
+        <release version="${AVIDEMUX_VERSION}" date="2019-03-21"/>
7
     </releases>
8
 </component>
9
avidemux_2.7.2.tar.gz/avidemux_core/ADM_core/include/ADM_crashdump.h -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_core/include/ADM_crashdump.h Changed
9
 
1
@@ -6,6 +6,7 @@
2
 #include "ADM_crashdump_apple.h"
3
 #include "ADM_crashdump_other.h"
4
 #include "ADM_crashdump_unix.h"
5
+#include "ADM_crashdump_vs.h"
6
 
7
 #ifdef __cplusplus
8
 extern "C"
9
avidemux_2.7.2.tar.gz/avidemux_core/ADM_core/include/ADM_crashdump_other.h -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_core/include/ADM_crashdump_other.h Changed
7
 
1
@@ -1,4 +1,4 @@
2
-#if !defined(__APPLE__) && !defined(__unix__) && !defined(__MINGW32__) && !defined ADM_CRASHDUMP_OTHER_H
3
+#if !defined(__APPLE__) && !defined(__unix__) && !defined(__MINGW32__) && !defined ADM_CRASHDUMP_OTHER_H &&!defined _MSC_VER
4
 #define ADM_CRASHDUMP_OTHER_H
5
 
6
 #define installSigHandler(...) {}
7
avidemux_2.7.3.tar.gz/avidemux_core/ADM_core/include/ADM_crashdump_vs.h Added
13
 
1
@@ -0,0 +1,11 @@
2
+/**
3
+ * \file ADM_crashdump_mingw
4
+ * \brief Catch low level error, mingw version
5
+ */
6
+#if defined(_MSC_VER) 
7
+
8
+#pragma once
9
+ADM_CORE6_EXPORT void installSigHandler(void);
10
+ADM_CORE6_EXPORT void uninstallSigHandler(void);
11
+
12
+#endif
13
avidemux_2.7.2.tar.gz/avidemux_core/ADM_core/src/ADM_crashdump_vs.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_core/src/ADM_crashdump_vs.cpp Changed
118
 
1
@@ -1,4 +1,114 @@
2
+#include <windows.h>
3
+#include <excpt.h>
4
+#include <string>
5
 #include "ADM_crashdump.h"
6
+static ADM_saveFunction *mysaveFunction = NULL;
7
+static ADM_fatalFunction *myFatalFunction = NULL;
8
+
9
+void ADM_setCrashHook(ADM_saveFunction *save, ADM_fatalFunction *fatal,ADM_sigIntFunction *other) 
10
+{
11
+   mysaveFunction = save;
12
+   myFatalFunction = fatal;
13
+ }
14
+
15
+/**
16
+ * 
17
+ * @param exceptionRecord
18
+ * @param contextRecord
19
+ */
20
+void HandleException(const char *message,struct _EXCEPTION_RECORD *exceptionRecord, struct _CONTEXT *contextRecord)
21
+{
22
+    std::string s;
23
+   fflush(stderr);
24
+   fflush(stdout); 
25
+
26
+   static int running = 0;
27
+
28
+   if (running)
29
+       exit(1);
30
+
31
+   running = 1;
32
+
33
+   if (mysaveFunction)
34
+       mysaveFunction();
35
+
36
+   
37
+
38
+   void *process = GetCurrentProcess();
39
+
40
+   fflush(stdout); 
41
+        
42
+        const char *title;
43
+        if(!message) title="Crash";
44
+            else     title=message;
45
+        if (myFatalFunction)
46
+       myFatalFunction(title, s.c_str());
47
+       fflush(stderr);
48
+   fflush(stdout); 
49
+   exit(1);
50
+}
51
+/**
52
+ * 
53
+ * @param exceptionRecord
54
+ * @param establisherFrame
55
+ * @param contextRecord
56
+ * @param dispatcherContext
57
+ * @return 
58
+ */
59
+EXCEPTION_DISPOSITION ExceptionHandler(struct _EXCEPTION_RECORD *exceptionRecord, void *establisherFrame, struct _CONTEXT *contextRecord, void *dispatcherContext)
60
+{
61
+   HandleException("ExceptionHandler",exceptionRecord, contextRecord);
62
+    return ExceptionContinueExecution;
63
+}
64
+/**
65
+ * 
66
+ * @param exceptionInfo
67
+ * @return 
68
+ */
69
+LONG WINAPI ExceptionFilter(struct _EXCEPTION_POINTERS *exceptionInfo)
70
+{
71
+   HandleException("ExceptionFilter",exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord);
72
+        return EXCEPTION_CONTINUE_SEARCH;
73
+}
74
+/**
75
+ * 
76
+ * @param pExceptionInfo
77
+ * @return 
78
+ */
79
+LONG WINAPI TopLevelExceptionHandler(struct _EXCEPTION_POINTERS *exceptionInfo)
80
+{
81
+    HandleException("TopLevelExceptionHandler",exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord);
82
+    return EXCEPTION_CONTINUE_SEARCH;
83
+}
84
+
85
+/**
86
+ * 
87
+ * @param info
88
+ * @param lineno
89
+ * @param file
90
+ */
91
+void ADM_backTrack(const char *info, int lineno, const char *file)
92
+{  
93
+    char title[2048]={0};
94
+        snprintf(title,2000,"%s at line %d, file %s\n",info,lineno,file);
95
+   HandleException(title,NULL, NULL);
96
+}
97
+
98
+
99
+/**
100
+ * \fn installSigHandler
101
+ * \brief add hook to catch exception (null pointers etc...)
102
+ */
103
+ADM_CORE6_EXPORT void installSigHandler(void)
104
+{    
105
+    SetUnhandledExceptionFilter(ExceptionFilter);
106
+}
107
+/**
108
+ * \fn uninstallSigHandler
109
+ * \brief
110
+ */
111
+ADM_CORE6_EXPORT void uninstallSigHandler(void)
112
+{
113
+    
114
+}
115
 
116
-void ADM_backTrack(const char *info, int lineno, const char *file) { }
117
-void ADM_setCrashHook(ADM_saveFunction *save, ADM_fatalFunction *fatal,ADM_sigIntFunction *other) { }
118
avidemux_2.7.2.tar.gz/avidemux_core/ADM_core/src/CMakeLists.txt -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_core/src/CMakeLists.txt Changed
9
 
1
@@ -4,7 +4,6 @@
2
         ADM_coreTranslator.cpp
3
         ADM_prettyPrint.cpp
4
 )
5
-
6
 IF (MINGW)
7
    SET(ADM_core_SRCS ${ADM_core_SRCS} ADM_crashdump_mingw.cpp ADM_folder_win32.cpp ADM_folder_mingw.cpp ADM_win32_mingw.cpp )
8
 ELSEIF (APPLE)
9
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreDemuxerMpeg/src/dmx_io.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreDemuxerMpeg/src/dmx_io.cpp Changed
10
 
1
@@ -188,6 +188,8 @@
2
                         if(myFd.fileSize >= threshold-tolerance && myFd.fileSize <= threshold+tolerance)
3
                             break;
4
                         threshold<<=1;
5
+                        if(i==1)
6
+                            tolerance<<=3; // 8 MiB starting with 1 GiB fragment size
7
                     }
8
                 }
9
                 count++;
10
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreImageLoader/include/ADM_imageLoader.h -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreImageLoader/include/ADM_imageLoader.h Changed
52
 
1
@@ -38,14 +38,16 @@
2
         {
3
             uint32_t i;
4
             i = 0;
5
-            i=(((uint32_t)(read16LE()))<<0)+(((uint32_t)read16LE())<<16);
6
+            i += (((uint32_t)(read16LE())) << 0);
7
+            i += (((uint32_t)read16LE()) << 16);
8
             return i;
9
         }    
10
         uint32_t    read32BE ()
11
         {
12
             uint32_t i;
13
             i = 0;
14
-            i=(((uint32_t)(read16BE()))<<16)+(((uint32_t)read16BE())<<0);
15
+            i += (((uint32_t)(read16BE())) << 16);
16
+            i +=(((uint32_t)read16BE()) << 0);
17
             return i;
18
         }        
19
     uint16_t    read16LE ()
20
@@ -53,7 +55,8 @@
21
             uint16_t i;
22
 
23
             i = 0;
24
-            i = (read8( ) ) + (read8( )<< 8);
25
+            i += (read8());
26
+            i +=(read8() << 8);
27
             return i;
28
         }    
29
         uint16_t    read16BE ()
30
@@ -61,7 +64,8 @@
31
             uint16_t i;
32
 
33
             i = 0;
34
-            i = (read8( ) <<8) + (read8( )<< 0);
35
+            i += (read8() << 8);
36
+            i += (read8());
37
             return i;
38
         }        
39
     uint8_t     read8 ()
40
@@ -88,7 +92,10 @@
41
         READ_FIELD(biBitCount,16)
42
         READ_FIELD(biCompression,32)            
43
         READ_FIELD(biSizeImage,32)
44
-        READ_FIELD(biSize,32)
45
+        READ_FIELD(biXPelsPerMeter,32)
46
+        READ_FIELD(biYPelsPerMeter,32)
47
+        READ_FIELD(biClrUsed,32)
48
+        READ_FIELD(biClrImportant,32)
49
     }    
50
     
51
 protected:
52
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreImageLoader/src/ADM_imageLoader.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreImageLoader/src/ADM_imageLoader.cpp Changed
201
 
1
@@ -105,12 +105,12 @@
2
             swap=true;
3
         }
4
 
5
-        if(ADM_COLOR_RGB24==sourceFormat)
6
+        if(ADM_COLOR_RGB24==sourceFormat || ADM_COLOR_BGR24==sourceFormat)
7
             swap=true;
8
 
9
-        ADMColorScalerSimple converter(w,h,sourceFormat,ADM_COLOR_YV12);     
10
-        converter.convertImage(source,image); 
11
-        
12
+        ADMColorScalerSimple converter(w,h,sourceFormat,ADM_COLOR_YV12);
13
+        converter.convertImage(source,image);
14
+
15
         if(swap)
16
         {
17
             uint8_t **s=image->_planes,*v;
18
@@ -205,7 +205,7 @@
19
  */
20
 static bool readJpegInfo(FILE *fd, int &width, int &height)
21
 {
22
-        uint16_t tag = 0, count = 0, off;
23
+        uint16_t tag = 0, count = 0, off = 0;
24
         int w,h;
25
         fseek(fd, 0, SEEK_END);
26
         int fileLength=ftell(fd);
27
@@ -305,8 +305,13 @@
28
         // Load the binary coded image
29
         ADM_byteBuffer buffer(_imgSize);
30
         fseek(fd, 0, SEEK_SET);
31
-        fread(buffer.at(0),_imgSize,1,fd);
32
+        int r=fread(buffer.at(0),_imgSize,1,fd);
33
         fclose(fd);
34
+        if(!r)
35
+        {
36
+            ADM_warning("Cannot read JPEG file.\n");
37
+            return NULL;
38
+        }
39
         //
40
 
41
         ADMImageRef tmpImage(w,h); // It is a reference image
42
@@ -335,7 +340,7 @@
43
 ADMImage *createImageFromFile_png(const char *filename)
44
 {
45
     
46
-    uint32_t offset,size;
47
+    uint32_t size;
48
     FILE *fd=NULL;
49
     uint32_t w,h;
50
 
51
@@ -356,8 +361,13 @@
52
        fseek(fd,0,SEEK_SET);
53
        ADM_byteBuffer buffer(size);
54
 
55
-       fread(buffer.at(0),size,1,fd);
56
+       int r=fread(buffer.at(0),size,1,fd);
57
        fclose(fd);
58
+       if(!r)
59
+       {
60
+           ADM_warning("Cannot read PNG file.\n");
61
+           return NULL;
62
+       }
63
        ADMImageRef tmpImage(w,h);
64
        // Decode PNG
65
         decoders *dec=ADM_coreCodecGetDecoder (fourCC::get((uint8_t *)"PNG "),   w,   h, 0 , NULL,0);
66
@@ -370,10 +380,7 @@
67
        bin.data=buffer.at(0);
68
        bin.dataLength=size; // This is more than actually, but who cares...
69
 
70
-       bool success=dec->uncompress (&bin, &tmpImage);
71
-   
72
-        
73
-        if(!success)
74
+        if(!dec->uncompress (&bin, &tmpImage))
75
         {
76
             ADM_warning("PNG Decompressing failed\n");
77
             delete dec;
78
@@ -397,10 +404,10 @@
79
 {
80
 
81
     ADM_BITMAPINFOHEADER bmph;
82
-    uint8_t fcc_tab[4];
83
     uint32_t offset;
84
     FILE *fd=NULL;
85
-    uint32_t w,h;
86
+    uint32_t w,h,bpp;
87
+    int bufSize;
88
 
89
    fd = ADM_fopen(filename, "rb");
90
         if(!fd)
91
@@ -415,7 +422,7 @@
92
  
93
         offset = reader.read32LE();
94
         reader.readBmphLE(bmph);
95
-        if (bmph.biCompression != 0 &bmph.biCompression!=3)
96
+        if(bmph.biCompression && bmph.biCompression!=3)
97
         {
98
             ADM_warning("[imageLoader] BMP2:Cannot handle compressed bmp (%08x)\n",bmph.biCompression);
99
             fclose(fd);
100
@@ -423,25 +430,87 @@
101
         }
102
         w = bmph.biWidth;
103
         h = bmph.biHeight;
104
+        if(w > MAXIMUM_SIZE)
105
+        {
106
+            ADM_warning("Width %u exceeds maximum supported (%u)\n",w,MAXIMUM_SIZE);
107
+            fclose(fd);
108
+            return NULL;
109
+        }
110
+        if(h > MAXIMUM_SIZE)
111
+        {
112
+            ADM_warning("Height %u exceeds maximum supported (%u)\n",h,MAXIMUM_SIZE);
113
+            fclose(fd);
114
+            return NULL;
115
+        }
116
+        bpp = bmph.biBitCount;
117
+        switch(bpp)
118
+        {
119
+            case 24:
120
+            case 32:
121
+                break;
122
+            default:
123
+                ADM_warning("Only 24 and 32 bpp bitmaps are supported.\n");
124
+                fclose(fd);
125
+                return NULL;
126
+        }
127
+
128
+        if(bpp == 32)
129
+        {
130
+            if(bmph.biCompression == 3)
131
+            { // read channel masks, FIXME: BGR is assumed
132
+                reader.read32LE(); // red
133
+                reader.read32LE(); // green
134
+                uint32_t bmask=reader.read32LE(); // blue
135
+                uint32_t amask=reader.read32LE(); // alpha
136
+                if((!amask && bmask == 0xff00) || amask == 0xff)
137
+                    bpp=96; // xBGR
138
+            }
139
+            bufSize=w*h*4;
140
+        }else // 24
141
+        {
142
+            bufSize=w*h*3;
143
+        }
144
+
145
         ADM_info("[imageLoader] BMP2 W: %" PRIu32" H: %" PRIu32" offset : %" PRIu32"\n", w, h, offset);
146
 // Load the binary coded image
147
    fseek(fd,offset,SEEK_SET);
148
         
149
-        ADM_byteBuffer buffer(w*h*4);
150
+        ADM_byteBuffer buffer(bufSize);
151
         
152
-        fread(buffer.at(0),w*h*4,1,fd);
153
+        uint32_t count=fread(buffer.at(0),bufSize,1,fd);
154
         fclose(fd);
155
+        if(!count)
156
+        {
157
+            ADM_warning("Read incomplete.\n");
158
+            return NULL;
159
+        }
160
+
161
+        // Decode DIB
162
+        decoders *dec=ADM_coreCodecGetDecoder (fourCC::get((uint8_t *)"DIB "), w, h, 0, NULL, bpp);
163
+        if(!dec)
164
+        {
165
+            ADM_warning("Cannot get DIB decoder");
166
+            return NULL;
167
+        }
168
 
169
-  // Colorconversion
170
+        ADMCompressedImage bin;
171
+        bin.data=buffer.at(0);
172
+        bin.dataLength=bufSize;
173
 
174
-       
175
-        ADMImageRefWrittable ref(w,h);
176
-        
177
-        ref._planes[0]=buffer.at(0)+(h-1)*w*3;
178
-        ref._planeStride[0]=-w*3;
179
-        ref._colorspace=ADM_COLOR_RGB24;
180
+        ADMImageRef ref(w,h);
181
 
182
-       return convertImageColorSpace(&ref,w,h);
183
+        if(!dec->uncompress(&bin,&ref))
184
+        {
185
+            ADM_warning("DIB decoding failed\n");
186
+            delete dec;
187
+            dec=NULL;
188
+            return NULL;
189
+        }
190
+
191
+        ADMImage *image=convertImageColorSpace(&ref,w,h);
192
+        delete dec;
193
+        dec=NULL;
194
+        return image;
195
 }
196
 /**
197
  *         \fn ADM_identidyImageFile
198
@@ -452,7 +521,6 @@
199
 {
200
     uint8_t fcc_tab[4];
201
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreUtils/src/avidemutils.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreUtils/src/avidemutils.cpp Changed
10
 
1
@@ -510,6 +510,8 @@
2
             break;
3
         }
4
         threshold<<=1;
5
+        if(i==1)
6
+            tolerance<<=3; // 8 MiB starting with 1 GiB fragment size
7
     }
8
     if(!success)
9
         return false;
10
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreVideoCodec/src/ADM_codecSearch.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreVideoCodec/src/ADM_codecSearch.cpp Changed
13
 
1
@@ -124,7 +124,10 @@
2
  if ((fcc == 0) || fourCC::check (fcc, (uint8_t *) "DIB "))
3
     {
4
       // RGB 16 Codecs
5
-      printf ("\n using DIB codec (%d bpp)\n",(int)bpp);
6
+      if(bpp!=96)
7
+          printf ("\n using DIB codec (%d bpp%s)\n",(int)bpp,(bpp==32)? " BGRx" : "");
8
+      else
9
+          printf ("\n using DIB codec (%d bpp xBGR)\n",32);
10
       return (decoders *) (new decoderRGB16 (w,h,fcc,extraLen,extraData,bpp));  //0
11
 
12
     }
13
avidemux_2.7.2.tar.gz/avidemux_core/ADM_coreVideoCodec/src/ADM_rgb16.cpp -> avidemux_2.7.3.tar.gz/avidemux_core/ADM_coreVideoCodec/src/ADM_rgb16.cpp Changed
52
 
1
@@ -26,7 +26,7 @@
2
     : decoders (  w,   h,  fcc,   extraDataLen,   extraData,  bpp)
3
 {
4
     _bpp = bpp;
5
-    bytePerPixel=_bpp>>3;
6
+    bytePerPixel=(_bpp & 0x3f)>>3;
7
     decoded = new uint8_t[2*bytePerPixel * w * h];
8
 }
9
 /**
10
@@ -56,7 +56,8 @@
11
                         colorspace = ADM_COLOR_RGB555;
12
                         break;
13
                 case 24:
14
-                case 32:
15
+                case 32: // BGRx
16
+                case 96: // fake bpp indicating xBGR
17
                         colorspace = ADM_COLOR_BGR24;
18
                         break;
19
                 default:
20
@@ -66,7 +67,7 @@
21
     // Pack...
22
         // Invert scanline
23
         src = in->data+lineSize*(_h-1);
24
-        if (_bpp == 32) // 32 -> 24
25
+        if (_bpp == 32 || _bpp == 96) // 32 -> 24
26
         {
27
             outBytePerPixel=3;   
28
             destStride=outBytePerPixel*_w;
29
@@ -77,11 +78,19 @@
30
 
31
                     for(j = 0; j < _w; j++) // 32 32 32 32
32
                     {
33
-                            ptr[0] = buf[1]; // remove alpha channel + reorder. IT would be more efficient to do it in colorspace...
34
+                        if(_bpp == 32)
35
+                        {
36
+                            ptr[0] = buf[0]; // remove alpha channel + reorder. IT would be more efficient to do it in colorspace...
37
+                            ptr[1] = buf[1];
38
+                            ptr[2] = buf[2];
39
+                        }else // xBGR
40
+                        {
41
+                            ptr[0] = buf[1];
42
                             ptr[1] = buf[2];
43
                             ptr[2] = buf[3];
44
-                            ptr += 3;
45
-                            buf += 4;
46
+                        }
47
+                        ptr += 3;
48
+                        buf += 4;
49
                     }
50
                     src -= lineSize;
51
                     dst += _w * 3;                    
52
avidemux_2.7.3.tar.gz/avidemux_core/ffmpeg_package/patches/upstream Added
2
 
1
+(directory)
2
avidemux_2.7.3.tar.gz/avidemux_core/ffmpeg_package/patches/upstream/0001-avutil-mem-gcc9.patch Added
32
 
1
@@ -0,0 +1,30 @@
2
+From 4361293fcf59edb56879c36edcd25f0a91e0edf8 Mon Sep 17 00:00:00 2001
3
+From: Mark Harris <mark.hsj@gmail.com>
4
+Date: Sat, 24 Nov 2018 13:02:02 -0800
5
+Subject: [PATCH] avutil/mem: Fix invalid use of av_alloc_size
6
+
7
+The alloc_size attribute is valid only on functions that return a
8
+pointer.  GCC 9 (not yet released) warns about invalid usage:
9
+
10
+./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function returning int' [-Wattributes]
11
+  342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
12
+      | ^~~~~~~~~~~~~
13
+
14
+Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
15
+---
16
+ libavutil/mem.h | 2 +-
17
+ 1 file changed, 1 insertion(+), 1 deletion(-)
18
+
19
+diff --git a/libavutil/mem.h b/libavutil/mem.h
20
+index 55ae573ac9a..5fb1a02dd9c 100644
21
+--- a/libavutil/mem.h
22
++++ b/libavutil/mem.h
23
+@@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size)
24
+  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
25
+  *          correctly aligned.
26
+  */
27
+-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
28
++int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
29
+ 
30
+ /**
31
+  * Reallocate the given buffer if it is not large enough, otherwise do nothing.
32
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_audioDecoders/ADM_ad_lav/ADM_ad_lav.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_audioDecoders/ADM_ad_lav/ADM_ad_lav.cpp Changed
129
 
1
@@ -259,7 +259,7 @@
2
         _blockalign=378;
3
       }
4
     }
5
-    ADM_info("[ADM_ad_lav] init successful (blockalign %d), channels=%d\n",info->blockalign,_context->channels);
6
+    ADM_info("[ADM_ad_lav] init successful (blockalign %d), channels=%d\n",_blockalign,_context->channels);
7
     if(_context->sample_rate!=outputFrequency)
8
     {
9
         ADM_warning("Output frequency does not match input frequency (SBR ?) : %d / %d\n",
10
@@ -424,49 +424,54 @@
11
     \fn run
12
 
13
 */
14
-
15
-#define CHECK_CONTENT(n)
16
-
17
 uint8_t ADM_AudiocoderLavcodec::run(uint8_t *inptr, uint32_t nbIn, float *outptr, uint32_t *nbOut)
18
 {
19
+    *nbOut=0;
20
+    // Shrink
21
+    if(_head && (_tail+nbIn)*3>ADMWA_BUF*2)
22
+    {
23
+        memmove(_buffer,_buffer+_head,_tail-_head);
24
+        _tail-=_head;
25
+        _head=0;
26
+    }
27
+    //
28
+    ADM_assert(nbIn+_tail<ADMWA_BUF);
29
+    memcpy(_buffer+_tail,inptr,nbIn);
30
+    _tail+=nbIn;
31
+
32
+    AVPacket pkt;
33
+    av_init_packet(&pkt);
34
+    int nbChunk,res=0;
35
+    while(_tail-_head>=_blockalign)
36
+    {
37
+        nbChunk=(_tail-_head)/_blockalign;
38
+        pkt.size=nbChunk*_blockalign;
39
+        pkt.data=_buffer+_head;
40
 
41
-        *nbOut=0;
42
-        // Shrink
43
-        if(_head && (_tail+nbIn)*3>ADMWA_BUF*2)
44
-        {
45
-            memmove(_buffer,_buffer+_head,_tail-_head);
46
-            _tail-=_head;
47
-            _head=0;
48
-        }
49
-        //
50
-        ADM_assert(nbIn+_tail<ADMWA_BUF);
51
-        memcpy(_buffer+_tail,inptr,nbIn);
52
-        _tail+=nbIn;
53
-
54
-        AVPacket pkt;
55
-        av_init_packet(&pkt);
56
-        int nbChunk,out,gotData;
57
-        while(_tail-_head>=_blockalign)
58
+        avcodec_send_packet(_context, &pkt);
59
+        // Regardless of the outcome, always consume the data.
60
+        _head+=nbChunk*_blockalign;
61
+
62
+        while(!res)
63
         {
64
-            nbChunk=(_tail-_head)/_blockalign;
65
-            pkt.size=nbChunk*_blockalign;
66
-            pkt.data=_buffer+_head;
67
-      
68
-            out=avcodec_decode_audio4(_context, _frame, &gotData, &pkt);
69
-            if(out<0)
70
+            res=avcodec_receive_frame(_context, _frame);
71
+            if(res==AVERROR(EAGAIN)) break; // we need to send more input
72
+            if(res==AVERROR_EOF)
73
+            {
74
+                return 1;
75
+            }
76
+            if(res<0)
77
             {
78
-                ADM_warning( "[ADM_ad_lav] *** decoding error (%u)***\n",_blockalign);
79
-                _head+=1; // Try skipping some bytes
80
-                continue;
81
+                char er[2048]={0};
82
+                av_make_error_string(er, sizeof(er)-1, res);
83
+                ADM_warning("[ADM_ad_lav] decoding error: %s\n",er);
84
+                return 1;
85
             }
86
-            _head+=out; // consumed bytes
87
-            if(!gotData)
88
-                continue;
89
+
90
             bool invalid=false;
91
             int  toCheck=1;
92
             if(_context->sample_fmt==AV_SAMPLE_FMT_FLTP || _context->sample_fmt==AV_SAMPLE_FMT_S32P)
93
                 toCheck=channels;
94
-            
95
 
96
             for(int i=0;i<toCheck;i++)
97
             {
98
@@ -477,20 +482,20 @@
99
                 }
100
             }
101
             if(invalid) 
102
-                continue;
103
+                break;
104
             switch(_context->sample_fmt)
105
             {
106
-              case AV_SAMPLE_FMT_FLT:     decodeToFloat(&outptr,nbOut);break;
107
-              case AV_SAMPLE_FMT_FLTP:    decodeToFloatPlanar(&outptr,nbOut);break;             
108
-              case AV_SAMPLE_FMT_S32P:    decodeToS32Planar(&outptr,nbOut);break;              
109
-              case AV_SAMPLE_FMT_S32:    decodeToS32(&outptr,nbOut);break;              
110
-              
111
-              default:
112
-                  ADM_info("Decoder created using ??? %d...\n",_context->sample_fmt);
113
-                  ADM_assert(0);
114
-                  break;
115
+                case AV_SAMPLE_FMT_FLT:     decodeToFloat(&outptr,nbOut);break;
116
+                case AV_SAMPLE_FMT_FLTP:    decodeToFloatPlanar(&outptr,nbOut);break;
117
+                case AV_SAMPLE_FMT_S32P:    decodeToS32Planar(&outptr,nbOut);break;
118
+                case AV_SAMPLE_FMT_S32:     decodeToS32(&outptr,nbOut);break;
119
+                default:
120
+                    ADM_info("Decoder created using ??? %d...\n",_context->sample_fmt);
121
+                    ADM_assert(0);
122
+                    break;
123
             }
124
         }
125
+    }
126
 
127
     if(!sbrChecked)
128
     {
129
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_audioEncoders/lavcodec/audioencoder_lavcodec.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_audioEncoders/lavcodec/audioencoder_lavcodec.cpp Changed
89
 
1
@@ -234,15 +234,15 @@
2
 bool AUDMEncoder_Lavcodec::lastBlock(AVPacket *pkt,int &encoded)
3
 {
4
     int gotPacket;
5
-    int nbout=avcodec_encode_audio2(CONTEXT, pkt,NULL,&gotPacket);
6
-         if(nbout<0)
7
-         {
8
-             printError("Encoding lastBlock",nbout);
9
-             return false;
10
-         }
11
-         if(gotPacket)
12
-               encoded=pkt->size;
13
-         return true;
14
+    int er=avcodec_encode_audio2(CONTEXT, pkt,NULL,&gotPacket);
15
+    if(er<0)
16
+    {
17
+        printError("Encoding lastBlock",er);
18
+        return false;
19
+    }
20
+    if(gotPacket)
21
+        encoded=pkt->size;
22
+    return true;
23
 }
24
 
25
 /**
26
@@ -297,17 +297,17 @@
27
             printError("Fill audio",er);
28
             return false;
29
         }
30
-         
31
-    int  nbout = avcodec_encode_audio2(CONTEXT, &pkt,_frame,&gotPacket);
32
-    if(nbout>=0 && gotPacket)
33
+
34
+    er = avcodec_encode_audio2(CONTEXT, &pkt,_frame,&gotPacket);
35
+    if(er<0)
36
     {
37
-        cprintf("Got %d bytes \n",pkt.size);
38
-        encoded=pkt.size;
39
+        printError("Encoding",er);
40
+        return false;
41
     }
42
-    else
43
+    if(gotPacket)
44
     {
45
-        printError("Encoding",nbout);
46
-        return false;
47
+        cprintf("Got %d bytes \n",pkt.size);
48
+        encoded=pkt.size;
49
     }
50
     return true;
51
 }
52
@@ -437,7 +437,6 @@
53
 */
54
 bool   AUDMEncoder_Lavcodec::encode(uint8_t *dest, uint32_t *len, uint32_t *samples)
55
 {
56
-  uint32_t nbout;
57
   int retries=16;
58
   bool r;
59
   int sz;
60
@@ -471,17 +470,17 @@
61
               {
62
                   if(false==encodeBlock(0,dest,sz))
63
                   {
64
-                        ADM_warning("Error while flushing lame\n");
65
+                        ADM_warning("Error flushing encoder\n");
66
                         return false;                      
67
                   }
68
                   *len=sz;
69
                   *samples=_chunk/channels;
70
-                  ADM_info("[Lav] Flushing, last block is %d bytes\n",nbout);
71
+                  ADM_info("[Lav] Flushing, last block is %d bytes\n",sz);
72
                   return true;
73
               }else
74
               {
75
               }
76
-              ADM_info("[Lav] No data to flush\n",nbout);
77
+              ADM_info("[Lav] No data to flush\n");
78
               return true;
79
         }
80
     }
81
@@ -507,7 +506,6 @@
82
 */
83
 bool configure (CONFcouple **setup)
84
 {
85
- int ret=0;
86
     lav_encoder config=defaultConfig;
87
     if(*setup)
88
     {
89
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Asf/ADM_asfPacket.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Asf/ADM_asfPacket.cpp Changed
27
 
1
@@ -138,7 +138,11 @@
2
    uint32_t  paddingLen;
3
    int   lengthTypeFlags,propertyFlags,multiplePayloadPresent;
4
    int sequenceType,sequence,offsetLenType,replicaLenType,streamNumberLenType,mediaObjectNumberLenType;
5
-   
6
+   int mediaObjectNumber, offset,replica,r;
7
+   int32_t remaining;
8
+   uint32_t payloadLen=0;
9
+   uint32_t keyframe;
10
+ 
11
 
12
     
13
    packetStart=ftello(_fd);
14
@@ -202,11 +206,7 @@
15
      packetLen=packetLen-paddingLen;
16
    }
17
 #endif
18
-   int mediaObjectNumber, offset,replica,r;
19
-   int32_t remaining;
20
-   uint32_t payloadLen;
21
-   uint32_t keyframe;
22
-   // Multi payload
23
+    // Multi payload
24
    if(multiplePayloadPresent)
25
     {
26
         uint8_t r=read8();
27
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkv.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkv.cpp Changed
47
 
1
@@ -74,10 +74,8 @@
2
 {
3
 
4
   ADM_ebml_file ebml;
5
-  uint64_t id,len;
6
+  uint64_t len;
7
   uint64_t alen;
8
-  ADM_MKV_TYPE type;
9
-  const char *ss;
10
 
11
   _timeBase=1000; // default value is 1 ms timebase (unit is in us)
12
   _isvideopresent=0;
13
@@ -210,7 +208,7 @@
14
         int bumped=0;
15
         for(int i=1;i<last;i++)
16
         {
17
-            uint64_t pts,dts;
18
+            uint64_t pts;
19
             pts=vid->index[i].Pts;
20
             lastDts+=increment; // This frame dts with no correction
21
             if(pts==ADM_NO_PTS)
22
@@ -457,8 +455,6 @@
23
   double dHalf=(500000.*(double)num)/((double)den);
24
   int half=dHalf-1; // half interval in us
25
   int first=0;
26
-  int bad=0;
27
-  int good=0;
28
   while(  track->index[first].Pts==ADM_NO_PTS && first<nb) first++; // we should have some at least
29
   uint64_t zero= track->index[first].Pts;
30
   ADM_info("Num=%d Den=%d half=%d zero=%d first=%d\n",num,den,half,(int)zero,first);
31
@@ -1086,6 +1082,7 @@
32
  * @param hd
33
  * @return
34
  */
35
+#if 0
36
 static int xypheLacingRead(uint8_t **hd)
37
 {
38
       int x=0;
39
@@ -1100,6 +1097,7 @@
40
       *hd=p;
41
       return x;
42
 }
43
+#endif
44
 /**
45
     \fn mkreformatVorbisHeader
46
     \brief reformat oggvorbis header to avidemux style
47
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvEntries.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvEntries.cpp Changed
11
 
1
@@ -245,8 +245,7 @@
2
       //***************** Audio tracks *****************
3
       if(entry.trackType==2 && _nbAudioTrack<ADM_MKV_MAX_TRACKS)
4
       {
5
-         uint32_t  streamIndex;
6
-         mkvTrak *t=&(_tracks[1+_nbAudioTrack]);
7
+        mkvTrak *t=&(_tracks[1+_nbAudioTrack]);
8
         t->extraDataLen=entry.extraDataLen;
9
         ADM_info("This track has %d bytes of  extradata\n",t->extraDataLen);
10
         // MS/ACM : ACMX
11
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvIndexer.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Matroska/ADM_mkvIndexer.cpp Changed
61
 
1
@@ -38,9 +38,7 @@
2
 */
3
 uint8_t mkvHeader::videoIndexer(ADM_ebml_file *parser)
4
 {
5
-  uint64_t fileSize,len,bsize;
6
-  uint32_t alen,vlen;
7
-  uint64_t id;
8
+  uint64_t len,id;
9
   ADM_MKV_TYPE type;
10
   const char *ss;
11
 
12
@@ -139,7 +137,7 @@
13
 */
14
 uint8_t mkvHeader::indexBlock(ADM_ebml_file *parser,uint32_t len,uint32_t clusterTimeCodeMs)
15
 {
16
-  int lacing,nbLaces,entryFlags=0;
17
+  int entryFlags=0;
18
   //
19
   uint64_t tail=parser->tell()+len;
20
   // Read Track id
21
@@ -158,7 +156,7 @@
22
       //if(!track) printf("TC: %d\n",timecode);
23
       uint8_t flags=parser->readu8();
24
 
25
-      lacing=((flags>>1)&3);
26
+      //int lacing=((flags>>1)&3);
27
 
28
       addIndexEntry(track,parser,blockBegin,tail-blockBegin,entryFlags,clusterTimeCodeMs+timecode);
29
       parser->seek(tail);
30
@@ -238,7 +236,7 @@
31
             parser->readBin(readBuffer+rpt,size-3);
32
             // Search the frame type...
33
 
34
-             uint32_t nb,vopType,timeinc=16;
35
+             uint32_t nb,timeinc=16;
36
              ADM_vopS vops[10];
37
              vops[0].type=AVI_KEY_FRAME;
38
              ADM_searchVop(readBuffer,readBuffer+rpt+size-3,&nb,vops, &timeinc);
39
@@ -285,7 +283,6 @@
40
                 parser->readBin(readBuffer+rpt,size-3);
41
                 uint8_t *begin=readBuffer;
42
                 uint8_t *end=readBuffer+size-3+rpt;
43
-                uint32_t flags=0;
44
                 while(begin<end)
45
                 {
46
                     int code=mkvFindStartCode(begin,end);
47
@@ -450,12 +447,11 @@
48
 */
49
 uint8_t   mkvHeader::indexClusters(ADM_ebml_file *parser)
50
 {
51
-  uint64_t fileSize,len,bsize;
52
+  uint64_t fileSize,len;
53
   uint64_t alen,vlen;
54
   uint64_t id;
55
   ADM_MKV_TYPE type;
56
   const char *ss;
57
-  uint64_t time;
58
   uint64_t pos;
59
   uint8_t res=1;
60
 
61
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4.cpp Changed
9
 
1
@@ -305,7 +305,6 @@
2
 
3
 uint8_t   MP4Header::getExtraHeaderData(uint32_t *len, uint8_t **data)
4
 {
5
-uint32_t old;
6
         *len=0;*data=NULL;
7
         if(_tracks[0].extraDataSize)
8
         {
9
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4.h -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4.h Changed
13
 
1
@@ -193,9 +193,9 @@
2
           int                           lookupIndex(int desc)          ;
3
           bool                          parseTrun(int trackNo,adm_atom &son,const mp4TrafInfo &info);
4
           uint8_t                       decodeVideoAtom(void *ztom);
5
-          uint8_t                       parseMdia(void *ztom,uint32_t *trackType,uint32_t w, uint32_t h);
6
+          uint8_t                       parseMdia(void *ztom,uint32_t *trackType);
7
           uint8_t                       parseEdts(void *ztom,uint32_t trackType);
8
-          uint8_t                       parseStbl(void *ztom,uint32_t trackType,uint32_t w,uint32_t h,uint32_t trackScale);
9
+          uint8_t                       parseStbl(void *ztom,uint32_t trackType,uint32_t trackScale);
10
           uint8_t                       decodeEsds(void *ztom,uint32_t trackType);
11
           uint8_t                       updateCtts(MPsampleinfo *info );
12
           bool                          refineFps(void);
13
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4Analyzer.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4Analyzer.cpp Changed
201
 
1
@@ -90,89 +90,86 @@
2
       \fn    LookupMainAtoms
3
       \brief Search main atoms to ease job for other part
4
 */
5
-uint8_t     MP4Header::lookupMainAtoms(void *ztom)
6
+uint8_t MP4Header::lookupMainAtoms(void *ztom)
7
 {
8
+    adm_atom *tom=(adm_atom *)ztom;
9
+    adm_atom *moov,*moof=NULL;
10
+    bool success=true;
11
+    ADMAtoms id;
12
+    uint32_t container;
13
+
14
+    ADM_info("Analyzing file and atoms\n");
15
 
16
-  adm_atom *tom=(adm_atom *)ztom;
17
-  adm_atom *moov,*moof=NULL;
18
-  bool success=true;
19
-  ADMAtoms id;
20
-  uint32_t container;
21
-  ADM_info("Analyzing file and atoms\n");
22
-  
23
-  if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOV,&moov))
24
-  {
25
-       ADM_warning("Cannot locate moov atom\n");
26
-       return 0;
27
-  }
28
-  ADM_assert(moov);
29
-  while(!moov->isDone())
30
-  {
31
-    adm_atom son(moov);
32
-    if(!ADM_mp4SearchAtomName(son.getFCC(), &id,&container))
33
+    if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOV,&moov))
34
     {
35
-      aprintf("[Lookup]Found atom %s unknown\n",fourCC::tostringBE(son.getFCC()));
36
+        ADM_warning("Cannot locate moov atom\n");
37
+        return 0;
38
     }
39
-    else
40
+    ADM_assert(moov);
41
+    while(!moov->isDone())
42
     {
43
-      switch( id)
44
-      {
45
-        case ADM_MP4_MVHD: parseMvhd(&son);break;
46
-        case ADM_MP4_TRACK:
47
-            if(!parseTrack(&son))
48
+        adm_atom son(moov);
49
+        if(!ADM_mp4SearchAtomName(son.getFCC(), &id,&container))
50
+        {
51
+            aprintf("[Lookup]Found atom %s unknown\n",fourCC::tostringBE(son.getFCC()));
52
+        }else
53
+        {
54
+            switch(id)
55
             {
56
-                ADM_info("Parse Track failed\n");
57
-                success=false;
58
-            } ;
59
-            break;
60
-        default :
61
-                aprintf("atom %s not handled\n",fourCC::tostringBE(son.getFCC()));
62
-                break;
63
-      }
64
-
65
-
66
+                case ADM_MP4_MVHD: parseMvhd(&son);break;
67
+                case ADM_MP4_TRACK:
68
+                    if(!parseTrack(&son))
69
+                    {
70
+                        ADM_info("Parse Track failed\n");
71
+                        success=false;
72
+                    }
73
+                    break;
74
+                default:
75
+                    aprintf("atom %s not handled\n",fourCC::tostringBE(son.getFCC()));
76
+                    break;
77
+            }
78
+        }
79
+        son.skipAtom();
80
     }
81
-    son.skipAtom();
82
-  }
83
-  delete moov;
84
-  if(!success)
85
-  {
86
-    if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOF,&moof))
87
+    delete moov;
88
+    if(!success)
89
     {
90
-         ADM_info("Cannot find all needed atoms\n");
91
-    }else
92
-    {
93
-         ADM_info("It is a Dash/fragmented file\n");
94
-          _flavor=Mp4Dash;
95
-          int moofFound=1;
96
-         while(1)
97
-         {
98
-             parseMoof(*moof);
99
-             delete moof;         
100
-             moof=NULL;
101
-             if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOF,&moof))
102
-             {
103
-                 break;
104
-             }
105
-             moofFound++;
106
-         }
107
-          ADM_info("Found %d fragments\n",moofFound);        
108
-   }
109
-  }
110
-  
111
-  ADM_info("Done finding main atoms\n");
112
-  return success;
113
+        if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOF,&moof))
114
+        {
115
+            ADM_info("Cannot find all needed atoms\n");
116
+        }else
117
+        {
118
+            ADM_info("It is a Dash/fragmented file\n");
119
+            _flavor=Mp4Dash;
120
+            int moofFound=1;
121
+            while(1)
122
+            {
123
+                parseMoof(*moof);
124
+                delete moof;
125
+                moof=NULL;
126
+                if(!ADM_mp4SimpleSearchAtom(tom, ADM_MP4_MOOF,&moof))
127
+                {
128
+                    break;
129
+                }
130
+                moofFound++;
131
+            }
132
+            ADM_info("Found %d fragments\n",moofFound);
133
+        }
134
+    }
135
+
136
+    ADM_info("Done finding main atoms\n");
137
+    return success;
138
 }
139
 /**
140
-      \fn parseMvhd
141
-      \brief Parse mvhd header
142
+    \fn parseMvhd
143
+    \brief Parse mvhd header
144
 */
145
 void MP4Header::parseMvhd(void *ztom)
146
 {
147
     adm_atom *tom = (adm_atom*)ztom;
148
     int version = tom->read();
149
 
150
-    tom->skipBytes(3);    // flags
151
+    tom->skipBytes(3); // flags
152
 
153
     if (version == 1)
154
         tom->skipBytes(16);
155
@@ -206,128 +203,131 @@
156
 */
157
 uint8_t MP4Header::parseTrack(void *ztom)
158
 {
159
-  adm_atom *tom=(adm_atom *)ztom;
160
-  ADMAtoms id;
161
-  uint32_t container;
162
-  uint32_t w,h;
163
-  uint32_t trackType=TRACK_OTHER;
164
-  _currentDelay=0;
165
-  _currentStartOffset=0;
166
-  ADM_info("Parsing Track\n");
167
-   while(!tom->isDone())
168
-  {
169
-     adm_atom son(tom);
170
-     if(!ADM_mp4SearchAtomName(son.getFCC(), &id,&container))
171
-     {
172
-       aprintf("[Track]Found atom %s unknown\n",fourCC::tostringBE(son.getFCC()));
173
-       son.skipAtom();
174
-       continue;
175
-     }
176
-     aprintf("\tProcessing atom %s \n",fourCC::tostringBE(son.getFCC()));
177
-     switch(id)
178
-     {
179
-       case ADM_MP4_TKHD:
180
-              {
181
-                  int version = son.read();
182
-
183
-                  son.skipBytes(3);
184
-
185
-                  if (version == 1)
186
-                      tom->skipBytes(16);
187
-                  else
188
-                      tom->skipBytes(8);
189
-
190
-                  aprintf("Track Id: %" PRIu32"\n", son.read32());
191
-                  son.skipBytes(4);
192
-
193
-                  uint64_t duration = (version == 1) ? son.read64() : son.read32();
194
-
195
-                  aprintf( "Duration: %" PRIu32" (ms)\n", (duration * 1000) / _videoScale);
196
-                  son.skipBytes(8);
197
-                  son.skipBytes(8);
198
-                  son.skipBytes(36);
199
-
200
-                  w = son.read32() >> 16;
201
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4Fragments.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4Fragments.cpp Changed
18
 
1
@@ -55,7 +55,7 @@
2
             {
3
                 case ADM_MP4_MFHD: son.skipAtom();break;
4
                 case ADM_MP4_TRAF: parseTraf(son,tom.getStartPos());break;
5
-                
6
+                default:break;
7
             }
8
             aprintf("[MOOF]Found atom %s \n",fourCC::tostringBE(son.getFCC()));
9
             son.skipAtom();
10
@@ -146,6 +146,7 @@
11
                     aprintf("[TFDT] Base DTS=%ld\n",(long int)info.baseDts);
12
                 }   
13
                     break;
14
+                default:break;
15
             }
16
            
17
             aprintf("[MOOF]Found atom %s \n",fourCC::tostringBE(son.getFCC()));
18
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4audio.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4audio.cpp Changed
18
 
1
@@ -62,7 +62,7 @@
2
        uint8_t sample[4];
3
 
4
        fseeko(_fd, _index[0].offset, SEEK_SET);
5
-       fread(&sample, 1, 4, _fd);
6
+       if(fread(&sample, 1, 4, _fd) < 4) return;
7
 
8
        uint32_t fcc = sample[0] << 24 | sample[1] << 16 | sample[2] << 8 | sample[3];
9
        int layer = 4 - ((fcc >> 17) & 0x3);
10
@@ -123,7 +123,6 @@
11
 bool    ADM_mp4AudioAccess::getPacket(uint8_t *buffer, uint32_t *size, uint32_t maxSize,uint64_t *dts)
12
 {
13
     uint32_t r=0;
14
-    double delta;
15
     if(_current_index>=_nb_chunks)
16
     {
17
         if(_msg_ratelimit->done())
18
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/OpenDml/ADM_odml_regular.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/OpenDml/ADM_odml_regular.cpp Changed
25
 
1
@@ -38,7 +38,7 @@
2
 uint32_t audioCount[9]={0,0,0,0, 0,0,0,0,0};
3
 uint32_t forward[9];
4
 uint32_t backward[9];
5
-int64_t startOfData;
6
+int64_t startOfData=0;
7
   
8
    printf("Trying avi type 1 index\n");
9
    if(!_regularIndex.offset)
10
@@ -123,14 +123,12 @@
11
         }
12
 
13
         uint32_t audiocount=0,videocount=0;
14
-        uint32_t audiototal=0;
15
         uint32_t audioSize=0;
16
         odmlIndex *track;
17
         int     Achunk;
18
         count=_regularIndex.size >> 4;
19
         while(count)
20
    {
21
-_again:
22
                 fcc=len=0;
23
                 fcc=read32();
24
                 flags=read32();
25
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/OpenDml/ADM_openDMLDepack.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/OpenDml/ADM_openDMLDepack.cpp Changed
47
 
1
@@ -41,9 +41,6 @@
2
 
3
 #define MAX_VOP 200
4
 
5
-/* Static ones */
6
-
7
-static const char *s_voptype[4]={"I frame","P frame","B frame","D frame"};
8
 /**
9
     \fn unpackPacked
10
     \brief Removed packed bitstream hack
11
@@ -52,7 +49,6 @@
12
 {
13
    uint32_t nbFrame;
14
    uint8_t ret=0;
15
-   uint32_t firstType, secondType,thirdType;
16
    uint32_t targetIndex=0,nbVop;
17
    uint32_t nbDuped=0;
18
     uint32_t timcincbits=16;  /* Nb bits used to code time_inc 16 is a safe default */
19
@@ -80,8 +76,8 @@
20
    #ifndef __HAIKU__
21
    uint32_t originalPriority = getpriority(PRIO_PROCESS, 0);
22
    #endif
23
-   uint32_t priorityLevel;
24
 #if 0
25
+   uint32_t priorityLevel;
26
    prefs->get(PRIORITY_INDEXING,&priorityLevel);
27
    setpriority(PRIO_PROCESS, 0, ADM_getNiceValue(priorityLevel));
28
 #endif
29
@@ -90,8 +86,6 @@
30
    ADMCompressedImage image;
31
     image.data=buffer;
32
    uint32_t img=0;
33
-    uint32_t modulo,time_inc,vopcoded,vopType;
34
-    uint32_t timeincbits=16;
35
     uint32_t oldtimecode=0xffffffff;
36
    while(img<nbFrame)
37
    {
38
@@ -149,8 +143,6 @@
39
        myVops[0].offset=0;
40
        myVops[nbVop].offset=image.dataLength;
41
 
42
-
43
-       uint32_t place;
44
                 //if(nbVop>2)
45
                 {
46
                         aprintf("At %u, %d vop!\n",img,nbVop);
47
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/Pictures/ADM_pics.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/Pictures/ADM_pics.cpp Changed
95
 
1
@@ -31,12 +31,15 @@
2
 #define aprintf printf
3
 #endif
4
 
5
-static uint16_t s16;
6
-static uint32_t s32;
7
 #define MAX_ACCEPTED_OPEN_FILE 99999
8
 
9
 #define US_PER_PIC (40*1000)
10
 
11
+#ifdef __APPLE__
12
+ #define MAX_LEN 1024
13
+#else
14
+ #define MAX_LEN 4096
15
+#endif
16
 
17
 /**
18
  * 
19
@@ -142,7 +145,6 @@
20
     
21
     bool r=true;
22
     uint16_t s16;
23
-    uint32_t s32;
24
     BmpLowLevel low(fd);
25
     
26
     switch(type) // this is bad. All the offsets are hardcoded and could be actually different.
27
@@ -164,6 +166,21 @@
28
                     break;
29
                 }
30
                 bpp = bmph.biBitCount;
31
+                if (bpp > 32)
32
+                {
33
+                    ADM_warning("Invalid bpp = %d\n",bpp);
34
+                    r=false;
35
+                    break;
36
+                }
37
+                if (bpp == 32 && bmph.biCompression == 3)
38
+                { // read channel masks, FIXME: BGR is assumed
39
+                    low.read32LE(); // red
40
+                    low.read32LE(); // green
41
+                    uint32_t bmask=low.read32LE(); // blue
42
+                    uint32_t amask=low.read32LE(); // alpha
43
+                    if((!amask && bmask == 0xff00) || amask == 0xff)
44
+                        bpp=96; // xBGR
45
+                }
46
                 aprintf("Bmp bpp=%d offset: %d (bmp header=%d,%d)\n", bpp, bmpHeaderOffset,sizeof(bmph),bmph.biSize);
47
             }
48
             break;
49
@@ -171,7 +188,12 @@
50
    {
51
        ADM_BITMAPINFOHEADER bmph;
52
 
53
-            fread(&s16, 2, 1, fd);
54
+            if (!fread(&s16, 2, 1, fd))
55
+            {
56
+                ADM_warning("Cannot read bmp file.\n");
57
+                r=false;
58
+                break;
59
+            }
60
        if (s16 != 0x4D42) 
61
             {
62
        ADM_warning(" incorrect bmp sig.\n");
63
@@ -234,7 +256,12 @@
64
  */
65
 uint8_t picHeader::open(const char *inname)
66
 {
67
-    uint32_t nnum;
68
+    if(strlen(inname)>=MAX_LEN)
69
+    {
70
+        ADM_warning("Path too long, aborting.\n");
71
+        return 0;
72
+    }
73
+
74
     FILE *fd;    
75
     int bpp = 0;
76
     
77
@@ -259,7 +286,7 @@
78
     }
79
     else
80
     {
81
-        char realstring[1024];
82
+        char realstring[MAX_LEN];
83
         sprintf(realstring, "%s%%0%" PRIu32"d.%s", prefix.c_str(), nbOfDigits, extension.c_str());
84
         _filePrefix=std::string(realstring);
85
         _nbFiles = 0;
86
@@ -369,7 +396,7 @@
87
  */
88
 FILE* picHeader::openFrameFile(uint32_t frameNum)
89
 {
90
-    char filename[250];
91
+    char filename[MAX_LEN];
92
     sprintf(filename, _filePrefix.c_str(), frameNum + _first);
93
     return ADM_fopen(filename, "rb");
94
 }
95
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vs.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vs.cpp Changed
77
 
1
@@ -17,10 +17,7 @@
2
 #include "ADM_default.h"
3
 #include "fourcc.h"
4
 #include "ADM_vs.h"
5
-#if !defined(__APPLE__) && !defined(_WIN32)
6
- #include <dlfcn.h>
7
-#endif
8
-
9
+#include "ADM_vsInternal.h"
10
 static const VSAPI *vsapi = NULL;
11
 #if 0
12
     #define aprintf printf
13
@@ -28,7 +25,7 @@
14
     #define aprintf(...) {}
15
 #endif
16
 uint32_t ADM_UsecFromFps1000(uint32_t fps1000);
17
-
18
+extern vsDynaLoader dynaLoader;
19
 /**
20
       \fn open
21
       \brief open the flv file, gather infos and build index(es).
22
@@ -37,11 +34,7 @@
23
 uint8_t vsHeader::open(const char *name)
24
 {
25
     ADM_info("Opening %s as VapourSynth file\n",name);
26
-#if !defined(__APPLE__) && !defined(_WIN32)
27
-    ADM_info("Trying to dlopen %s\n",VAPOURSYNTH_PYTHONLIB);
28
-    dlopen(VAPOURSYNTH_PYTHONLIB, RTLD_LAZY|RTLD_GLOBAL);
29
-#endif
30
-    inited+=!!vsscript_init();
31
+    inited+=!!dynaLoader.init();
32
     if(!inited)
33
     {
34
         ADM_warning("Cannot initialize vsapi script_init. Check PYTHONPATH\n");
35
@@ -49,7 +42,7 @@
36
     }
37
     if(!vsapi)
38
     {
39
-        vsapi = vsscript_getVSApi();
40
+        vsapi = dynaLoader.getVSApi();
41
         if(!vsapi)
42
         {
43
             ADM_warning("Cannot get vsAPI entry point\n");
44
@@ -58,13 +51,13 @@
45
         }
46
     }
47
     ADM_info("VapourSynth init ok, opening file..\n");
48
-    if (vsscript_evaluateFile(&_script, name, 0)) 
49
+    if (dynaLoader.evaluateFile(&_script, name, 0)) 
50
     {
51
-        ADM_warning("Evaluate script failed <%s>\n", vsscript_getError(_script));
52
+        ADM_warning("Evaluate script failed <%s>\n", dynaLoader.getError(_script));
53
         close();
54
         return 0;
55
     }
56
-    _node = vsscript_getOutput(_script, 0);
57
+    _node = dynaLoader.getOutput(_script, 0);
58
     if (!_node) 
59
     {
60
         ADM_warning("vsscript_getOutputNode failed\n");
61
@@ -194,13 +187,13 @@
62
     }
63
     if(_script)
64
     {
65
-        vsscript_freeScript(_script);
66
+        dynaLoader.freeScript(_script);
67
         _script=NULL;
68
     }
69
     while(inited)
70
     {
71
         inited--;
72
-        vsscript_finalize();
73
+        dynaLoader.finalize();
74
     }
75
     vsapi=NULL;
76
     return 1;
77
avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vsInternal.h Added
88
 
1
@@ -0,0 +1,85 @@
2
+#pragma once
3
+
4
+#include "ADM_dynamicLoading.h"
5
+
6
+#if !defined(__APPLE__) && !defined(_WIN32)
7
+ #include <dlfcn.h>
8
+#endif
9
+
10
+
11
+
12
+
13
+#ifdef __APPLE__
14
+        #define  DLL_TO_LOAD "libvapoursynth-script.dylib"
15
+        #define  PYTHONLIB ""
16
+#else
17
+    #ifdef _WIN32
18
+        #define  DLL_TO_LOAD "vsscript.dll"
19
+        #define  PYTHONLIB ""
20
+    #else
21
+        #define  DLL_TO_LOAD "libvapoursynth-script.so"
22
+        #define  PYTHONLIB VAPOURSYNTH_PYTHONLIB
23
+    #endif
24
+#endif
25
+
26
+
27
+/**
28
+ * 
29
+ */
30
+class vsDynaLoader:public ADM_LibWrapper
31
+{
32
+public:
33
+  
34
+    vsDynaLoader()
35
+    {
36
+      init=NULL;
37
+      getVSApi=NULL;
38
+      freeScript=NULL;
39
+      finalize=NULL;
40
+      getError=NULL;
41
+      getOutput=NULL;
42
+      evaluateFile=NULL;
43
+      operational=false;
44
+    }
45
+    bool vsInit(const char *dllName,const char *pythonLib)
46
+    {
47
+#if !defined(__APPLE__) && !defined(_WIN32)      
48
+      ADM_info("Trying to dlopen %s\n",VAPOURSYNTH_PYTHONLIB);
49
+      dlopen(VAPOURSYNTH_PYTHONLIB, RTLD_LAZY|RTLD_GLOBAL);
50
+#endif      
51
+      bool loaded= loadLibrary(dllName);
52
+      if(!loaded) 
53
+      {
54
+          ADM_warning("Cannot load the vapoursynth-script library\n");
55
+          return false;
56
+      }
57
+      if(!     ADM_LibWrapper::getSymbols(7,
58
+               &init,          "vsscript_init",
59
+                                &getVSApi,      "vsscript_getVSApi",
60
+                                &freeScript,    "vsscript_freeScript",
61
+                                &finalize,      "vsscript_finalize",
62
+                                &getError,      "vsscript_getError",
63
+                                &getOutput,     "vsscript_getOutput",
64
+                                &evaluateFile,  "vsscript_evaluateFile"))
65
+        {
66
+            ADM_warning("Cannot get symbols from vapoursynthlibrary\n");
67
+            return false;
68
+        }
69
+      operational=true;
70
+      return true;
71
+    }
72
+    bool isOperational()
73
+    {
74
+      return operational;
75
+    }
76
+public:  
77
+    int             (*init)(void);
78
+    const VSAPI     *(*getVSApi)(void);
79
+    void            (*freeScript)(VSScript *handle);
80
+    int             (*finalize)(void);
81
+    const char      *(*getError)(VSScript *handle);
82
+    VSNodeRef *      (*getOutput)(VSScript *handle, int index);
83
+    int              (*evaluateFile)(VSScript **handle, const char *scriptFilename, int flags);
84
+protected:    
85
+    bool             operational;
86
+};
87
\ No newline at end of file
88
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vsPlugin.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vsPlugin.cpp Changed
37
 
1
@@ -16,19 +16,35 @@
2
 #include "ADM_default.h"
3
 #include "ADM_vs.h"
4
 #include "ADM_demuxerInternal.h"
5
+#include "ADM_vsInternal.h"
6
 
7
+#if !defined(__APPLE__) && !defined(_WIN32)
8
+ #include <dlfcn.h>
9
+#endif
10
+
11
+
12
+vsDynaLoader dynaLoader;
13
+static bool loaded=false;
14
 ADM_DEMUXER_BEGIN( vsHeader, 50,
15
                     1,0,0,
16
                     "vs",
17
                     "VapourSynth demuxer plugin (c) Mean 2015"
18
                 );
19
 
20
+
21
 /**
22
     \fn Probe
23
 */
24
 
25
 extern "C"  uint32_t     ADM_PLUGIN_EXPORT    probe(uint32_t magic, const char *fileName)
26
 {
27
+        
28
+        // Check if we have the lib loaded
29
+        if(!loaded)
30
+            dynaLoader.vsInit(DLL_TO_LOAD,PYTHONLIB);
31
+        loaded=true;
32
+        if(!dynaLoader.isOperational())
33
+            return 0;
34
         std::string fname=std::string(fileName);
35
         if(fname.length()<4) return 0;
36
         if (fname.substr(fname.length()-4) == std::string(".vpy"))
37
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vsProxy.cpp -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/ADM_vsProxy.cpp Changed
81
 
1
@@ -18,9 +18,12 @@
2
 #include "fourcc.h"
3
 
4
 #include "ADM_vsProxy.h"
5
-
6
+#include "ADM_vsInternal.h"
7
 
8
 static const VSAPI *vsapi = NULL;
9
+vsDynaLoader dynaLoader;
10
+static bool loaded=false;
11
+
12
 
13
 
14
 /**
15
@@ -47,10 +50,10 @@
16
 {
17
         if(_script)
18
         {
19
-            vsscript_freeScript(_script);
20
+            dynaLoader.freeScript(_script);
21
             _script=NULL;
22
         }
23
-        vsscript_finalize();
24
+        dynaLoader.finalize();
25
 }
26
 /**
27
  * 
28
@@ -88,29 +91,35 @@
29
 
30
     ADM_info("Opening %s as VapourSynth file\n",name);
31
     
32
+    if(!loaded)
33
+         dynaLoader.vsInit(DLL_TO_LOAD,PYTHONLIB);
34
+     loaded=true;
35
+     if(!dynaLoader.isOperational())
36
+         return 0;
37
+    
38
    
39
     
40
-    if (!vsscript_init()) 
41
+    if (!dynaLoader.init()) 
42
     {
43
           ADM_warning("Cannot initialize vsapi script_init. Check PYTHONPATH\n");
44
           return false;
45
     }
46
-    vsapi = vsscript_getVSApi();
47
+    vsapi = dynaLoader.getVSApi();
48
     if(!vsapi)
49
     {
50
         ADM_warning("Cannot get vsAPI entry point\n");
51
-        vsscript_finalize();
52
+        dynaLoader.finalize();
53
         return 0;
54
     }
55
         
56
     ADM_info("VapourSynth init ok, opening file..\n");
57
-    if (vsscript_evaluateFile(&_script, name, 0)) 
58
+    if (dynaLoader.evaluateFile(&_script, name, 0)) 
59
     {
60
-        ADM_warning("Evaluate script failed <%s>\n", vsscript_getError(_script));
61
+        ADM_warning("Evaluate script failed <%s>\n", dynaLoader.getError(_script));
62
         abort();
63
         return 0;
64
     }
65
-    _node = vsscript_getOutput(_script, 0);
66
+    _node = dynaLoader.getOutput(_script, 0);
67
     if (!_node) 
68
     {
69
        ADM_warning("vsscript_getOutputNode failed\n");
70
@@ -166,8 +175,8 @@
71
     bool success=manageSlave(slave,vi);
72
     delete slave;
73
     vsapi->freeNode(_node);
74
-    vsscript_freeScript(_script);
75
-    vsscript_finalize();
76
+    dynaLoader.freeScript(_script);
77
+    dynaLoader.finalize();
78
     _node=NULL;
79
     _script=NULL;
80
     return success;
81
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/CMakeLists.txt -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/CMakeLists.txt Changed
67
 
1
@@ -1,6 +1,12 @@
2
 include(admCheckVapourSynth)
3
 include(dm_plugin)
4
 checkVapourSynth()
5
+
6
+ IF(NOT APPLE AND NOT WIN32 AND NOT MSVC)
7
+           SET(VS_SYSTEM_LIBS "-ldl")
8
+ENDIF(NOT APPLE AND NOT WIN32 AND NOT MSVC)
9
+
10
+
11
 IF(USE_VAPOURSYNTH)
12
     IF(DO_COMMON)
13
         IF(NOT APPLE)
14
@@ -12,29 +18,12 @@
15
             #ADD_DEFINITIONS("-std=c++11")
16
             ADD_DEFINITIONS(${VAPOURSYNTHSCRIPT_CFLAGS})
17
             SET(SRCS ADM_vsProxy.cpp ADM_vsProxy_cli.cpp)
18
-            ADD_EXECUTABLE(vsProxy ${SRCS})
19
-            GET_PROPERTY(OLD
20
-                        TARGET vsProxy
21
-                        PROPERTY LINK_FLAGS)
22
-            IF("${OLD}" MATCHES ".*NOT.*FOUND")
23
-                SET(OLD "")
24
-            ENDIF("${OLD}" MATCHES ".*NOT.*FOUND")
25
-# Keep -L, discard everything else
26
-            FOREACH(i ${VAPOURSYNTHSCRIPT_LDFLAGS})
27
-                IF(${i} MATCHES "^-L")
28
-                    MESSAGE(STATUS "Updating linker flags  => ${i}")
29
-                    SET(OLD "${i} ${OLD} ")
30
-                ELSE(${i} MATCHES "^-L")
31
-                    MESSAGE(STATUS "Updating linker libs  => ${i}")
32
-                    LIST(APPEND LIBS_TO_LINK  ${i})
33
-                ENDIF(${i} MATCHES "^-L")
34
-            ENDFOREACH(i ${VAPOURSYNTHSCRIPT_LDFLAGS})
35
+            ADD_EXECUTABLE(vsProxy ${SRCS})                      
36
             # Add vs Proxy
37
             SET_TARGET_PROPERTIES(vsProxy PROPERTIES LINK_FLAGS "${OLD}")
38
-            TARGET_LINK_LIBRARIES(vsProxy ${LIBS_TO_LINK} ADM_core6 ADM_coreSocket6)
39
+            TARGET_LINK_LIBRARIES(vsProxy ADM_core6 ADM_coreSocket6)
40
         ELSE(NOT APPLE)
41
             ADD_DEFINITIONS(${VAPOURSYNTHSCRIPT_CFLAGS})
42
-            LIST(APPEND LIBS_TO_LINK ${VAPOURSYNTHSCRIPT_LDFLAGS})
43
         ENDIF(NOT APPLE)
44
         #----------------
45
         # Add direct Loading
46
@@ -43,10 +32,8 @@
47
                 )
48
         INIT_DEMUXER(ADM_dm_vapoursynth)
49
         ADD_DEMUXER(ADM_dm_vapoursynth ${ADM_vs_SRCS})
50
-        IF(NOT APPLE AND NOT WIN32 AND NOT MSVC)
51
-            LIST(APPEND LIBS_TO_LINK "-ldl")
52
-        ENDIF(NOT APPLE AND NOT WIN32 AND NOT MSVC)
53
-        TARGET_LINK_LIBRARIES(ADM_dm_vapoursynth ${LIBS_TO_LINK})
54
+        TARGET_LINK_LIBRARIES(ADM_dm_vapoursynth "${VS_SYSTEM_LIBS}")
55
+
56
         INSTALL_DEMUXER(ADM_dm_vapoursynth)
57
         #----------------
58
         IF(NOT APPLE)
59
@@ -59,6 +46,7 @@
60
             ELSE(WIN32)
61
                 TARGET_LINK_LIBRARIES(vsProxy -lstdc++) # clang
62
             ENDIF(WIN32)
63
+            TARGET_LINK_LIBRARIES(vsProxy "${VS_SYSTEM_LIBS}")
64
             ADM_INSTALL_BIN(vsProxy)
65
         ENDIF(NOT APPLE)
66
    ENDIF(DO_COMMON)
67
avidemux_2.7.2.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt -> avidemux_2.7.3.tar.gz/avidemux_plugins/ADM_demuxers/VapourSynth/qt4/CMakeLists.txt Changed
25
 
1
@@ -46,15 +46,7 @@
2
    SET(OLD "")
3
 ENDIF("${OLD}" MATCHES ".*NOT.*FOUND")
4
 # Keep -L, discard everything else
5
-FOREACH(i ${VAPOURSYNTHSCRIPT_LDFLAGS})
6
-  IF(${i} MATCHES "^-L")
7
-        MESSAGE(STATUS "Updating linker flags  => ${i}")
8
-        SET(OLD "${i} ${OLD} ") 
9
-  ELSE(${i} MATCHES "^-L")
10
-        MESSAGE(STATUS "Updating linker libs  => ${i}")
11
-        LIST(APPEND LIBS_TO_LINK  ${i})
12
-  ENDIF(${i} MATCHES "^-L")
13
-ENDFOREACH(i ${VAPOURSYNTHSCRIPT_LDFLAGS})
14
+
15
 
16
 SET_TARGET_PROPERTIES(vsProxy_gui_${QT_EXTENSION}  PROPERTIES LINK_FLAGS "${OLD}")
17
 
18
@@ -73,5 +65,5 @@
19
        set_target_properties(vsProxy_gui_${QT_EXTENSION} PROPERTIES WIN32_EXECUTABLE True)
20
        TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} ws2_32.lib  winmm -mwindows  )
21
 ENDIF(MSVC)
22
-
23
+TARGET_LINK_LIBRARIES(vsProxy_gui_${QT_EXTENSION} "${VS_SYSTEM_LIBS}")
24
 ADM_INSTALL_BIN(vsProxy_gui_${QT_EXTENSION})
25
avidemux_2.7.2.tar.gz/cmake/admCheckVapourSynth.cmake -> avidemux_2.7.3.tar.gz/cmake/admCheckVapourSynth.cmake Changed
23
 
1
@@ -12,6 +12,7 @@
2
                 STRING(REGEX REPLACE "so.*$" "so" shortened "${shortened}" )
3
                 # Now it looks like this libpython3.6m.so
4
                 set(${result} ${shortened})
5
+                MESSAGE(STATUS "Got python lib :  ${${result}}")
6
             endif(dep MATCHES ".*libpython3.*")
7
         endforeach(dep ${xoutput})
8
     endmacro(GET_VAPOURSYNTH_PYTHON lib)
9
@@ -25,10 +26,10 @@
10
        IF (VAPOURSYNTH)
11
                         PKG_CHECK_MODULES(VAPOURSYNTHSCRIPT vapoursynth-script)
12
                         IF (VAPOURSYNTHSCRIPT_FOUND)
13
-                                MESSAGE(STATUS "VSSCRIPT<${VAPOURSYNTHSCRIPT_CFLAGS}>  < ${VAPOURSYNTHSCRIPT_LDFLAGS}>")
14
+                                MESSAGE(STATUS "VSSCRIPT<${VAPOURSYNTHSCRIPT_CFLAGS}>  < ${VAPOURSYNTHSCRIPT_LDFLAGS}> <${VAPOURSYNTHSCRIPT_LIBRARIES}>")
15
                                 IF(NOT APPLE AND NOT WIN32)
16
-                                    LIST(GET VAPOURSYNTHSCRIPT_LINK_LIBRARIES 0  xfirst)
17
-                                    GET_VAPOURSYNTH_PYTHON( ${xfirst} VAPOURSYNTH_PYTHONLIB)
18
+                                    LIST(GET VAPOURSYNTHSCRIPT_LIBRARIES 0  xfirst)
19
+                                    GET_VAPOURSYNTH_PYTHON( "${VAPOURSYNTHSCRIPT_LIBDIR}/lib${xfirst}.so" VAPOURSYNTH_PYTHONLIB)
20
                                     SET(VAPOURSYNTHSCRIPT_CFLAGS "${VAPOURSYNTHSCRIPT_CFLAGS} -DVAPOURSYNTH_PYTHONLIB='\"${VAPOURSYNTH_PYTHONLIB}\"'")
21
                                 ENDIF(NOT APPLE AND NOT WIN32)
22
                                 SET(USE_VAPOURSYNTH 1)
23
avidemux_2.7.2.tar.gz/cmake/avidemuxVersion.cmake -> avidemux_2.7.3.tar.gz/cmake/avidemuxVersion.cmake Changed
10
 
1
@@ -7,7 +7,7 @@
2
 include(admTimeStamp)
3
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
4
 SET(CPACK_PACKAGE_VERSION_MINOR "7")
5
-SET(CPACK_PACKAGE_VERSION_P     "2")
6
+SET(CPACK_PACKAGE_VERSION_P     "3")
7
 SET(AVIDEMUX_MAJOR_MINOR "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
8
 SET(CPACK_PACKAGE_VERSION_PATCH "${CPACK_PACKAGE_VERSION_P}")
9
 IF(NOT AVIDEMUX_VERSION)
10