Control: tags -1 + patch

On 2014-02-18 19:05:33, Moritz Muehlenhoff wrote:
>  g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat 
> -Werror=format-security -D_FORTIFY_SOURCE=2 -m64 -pipe -O2 -Wall -W 
> -D_REENTRANT -fPIC -DQT_WEBKIT -DHAVE_QUAZIP -DHAVE_THEORA -DHAVE_FFMPEG 
> -DHAVE_ZLIB -DVERSION=\"0.2\" -DCODE_NAME=\"Ajuba\" -DREVISION=\"git02\" 
> -DK_DEBUG -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SVG_LIB -DQT_XML_LIB -DQT_OPENGL_LIB 
> -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED 
> -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore 
> -I/usr/include/qt4/QtNetwork
> -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml 
> -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I../../../framework 
> -I../../../framework/tcore -I../../../framework/tgui -I../../../store 
> -I../../../libtupi -I../../../libbase -I/usr/include/quazip 
> -I/usr/include/ffmpeg/ -I/usr/X11R6/include -I.moc -o 
> .obj/tffmpegmoviegenerator.o tffmpegmoviegenerator.cpp
> tffmpegmoviegenerator.cpp: In function 'AVStream* 
> addVideoStream(AVFormatContext*, AVCodec**, AVCodecID, const QString&, int, 
> int, int, const char*)':
> tffmpegmoviegenerator.cpp:124:24: error: 'CODEC_ID_MPEG2VIDEO' was not 
> declared in this scope
>      if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
>                         ^
> tffmpegmoviegenerator.cpp:129:24: error: 'CODEC_ID_MPEG1VIDEO' was not 
> declared in this scope
>      if (c->codec_id == CODEC_ID_MPEG1VIDEO) {
>                         ^
> tffmpegmoviegenerator.cpp: In member function 'bool 
> TFFMpegMovieGenerator::Private::openVideo(AVCodec*, AVStream*)':
> tffmpegmoviegenerator.cpp:194:13: warning: 'AVFrame* avcodec_alloc_frame()' 
> is deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>      frame = avcodec_alloc_frame();
>              ^
> tffmpegmoviegenerator.cpp:194:33: warning: 'AVFrame* avcodec_alloc_frame()' 
> is deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) 
> [-Wdeprecated-declarations]
>      frame = avcodec_alloc_frame();
>                                  ^
> tffmpegmoviegenerator.cpp: In member function 'virtual bool 
> TFFMpegMovieGenerator::begin()':
> tffmpegmoviegenerator.cpp:385:32: error: 'CODEC_ID_NONE' was not declared in 
> this scope
>      if (k->fmt->video_codec != CODEC_ID_NONE) {
>                                 ^

The attached patch fixes this issue. Since there is already special
casing for libav 9 and newer present in the package, there should be no
special casing needed for older versions (in case the patch is going to
be sent to upstream).

Regards
-- 
Sebastian Ramacher
--- a/src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.debian.cpp
+++ b/src/plugins/export/ffmpegplugin/tffmpegmoviegenerator.debian.cpp
@@ -121,12 +121,12 @@
         c->pix_fmt = AV_PIX_FMT_YUV420P;
     }
 
-    if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
+    if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
 	/* just for testing, we also add B frames */
 	c->max_b_frames = 2;
     }
 
-    if (c->codec_id == CODEC_ID_MPEG1VIDEO) {
+    if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
         /* needed to avoid using macroblocks in which some coeffs overflow
            this doesnt happen with normal video, it just happens here as the
            motion of the chroma plane doesnt match the luma plane */
@@ -382,7 +382,7 @@
     }
 
     k->video_st = NULL;
-    if (k->fmt->video_codec != CODEC_ID_NONE) {
+    if (k->fmt->video_codec != AV_CODEC_ID_NONE) {
         k->video_st = addVideoStream(k->oc, &video_codec, k->fmt->video_codec, k->movieFile, width(), height(), k->fps, k->errorMsg);
     }
 

Attachment: signature.asc
Description: Digital signature

Reply via email to