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