Control: tags -1 + patch

On 2014-02-17 19:52:36, Moritz Muehlenhoff wrote:
> Source: libphash
> Severity: important
> 
> Hi,
> your package fails to build from source against libav 10 (currently
> packaged in experimental). This bug will become release-critical
> at some point when the libav10 transition starts.
> 
> Migration documentation can be found at
> https://wiki.libav.org/Migration/10
> 
> Cheers,
>         Moritz
> 
> cimgffmpeg.cpp: In function 'int NextFrames(VFInfo*, 
> cimg_library::CImgList<unsigned char>*)':
> cimgffmpeg.cpp:257:9: warning: 'AVFrame* avcodec_alloc_frame()' is deprecated 
> (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>   pFrame=avcodec_alloc_frame();
>          ^
> cimgffmpeg.cpp:257:29: warning: 'AVFrame* avcodec_alloc_frame()' is 
> deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>   pFrame=avcodec_alloc_frame();
>                              ^
> cimgffmpeg.cpp:260:29: warning: 'AVFrame* avcodec_alloc_frame()' is 
> deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>   AVFrame *pConvertedFrame = avcodec_alloc_frame();
>                              ^
> cimgffmpeg.cpp:260:49: warning: 'AVFrame* avcodec_alloc_frame()' is 
> deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>   AVFrame *pConvertedFrame = avcodec_alloc_frame();
>                                                  ^
> cimgffmpeg.cpp: In function 'float fps(const char*)':
> cimgffmpeg.cpp:434:47: error: 'AVStream' has no member named 'r_frame_rate'
>   int num = (pFormatCtx->streams[videoStream]->r_frame_rate).num;
>                                                ^
> cimgffmpeg.cpp:435:47: error: 'AVStream' has no member named 'r_frame_rate'
>   int den = (pFormatCtx->streams[videoStream]->r_frame_rate).den;

The attached patch should fix this issue.

Regards
-- 
Sebastian Ramacher
diff -u libphash-0.9.4/src/cimgffmpeg.cpp libphash-0.9.4/src/cimgffmpeg.cpp
--- libphash-0.9.4/src/cimgffmpeg.cpp
+++ libphash-0.9.4/src/cimgffmpeg.cpp
@@ -431,8 +431,8 @@
         if(videoStream==-1)
 	    return -1; // Didn't find a video stream
 	
-	int num = (pFormatCtx->streams[videoStream]->r_frame_rate).num;
-	int den = (pFormatCtx->streams[videoStream]->r_frame_rate).den;
+	int num = (pFormatCtx->streams[videoStream]->avg_frame_rate).num;
+	int den = (pFormatCtx->streams[videoStream]->avg_frame_rate).den;
 	result = num/den;
 
 	avformat_close_input(&pFormatCtx);

Attachment: signature.asc
Description: Digital signature

Reply via email to