Package: ffdiaporama Version: 1.5-4 Severity: important Tags: patch User: pkg-multimedia-maintain...@lists.alioth.debian.org Usertags: ffmpeg2.9
Dear Maintainer, your package fails to build with the upcoming ffmpeg 2.9. This bug will become release-critical at some point when the ffmpeg2.9 transition gets closer. Attached is a patch replacing the deprecated functionality. It also works with ffmpeg 2.8. Please apply this patch and forward it upstream, if necessary. These changes are non-trivial and should be runtime-tested. Best regards, Andreas
diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch new file mode 100644 index 0000000..2035493 --- /dev/null +++ b/debian/patches/ffmpeg_2.9.patch @@ -0,0 +1,161 @@ +Description: Replace deprecated FFmpeg API +Author: Andreas Cadhalpun <andreas.cadhal...@googlemail.com> +Last-Update: <2015-11-02> + +--- ffdiaporama-1.5.orig/src/engine/cBaseMediaFile.cpp ++++ ffdiaporama-1.5/src/engine/cBaseMediaFile.cpp +@@ -1571,7 +1571,7 @@ void cVideoFile::CloseCodecAndFile() { + } + + if (FrameBufferYUV!=NULL) { +- av_free(FrameBufferYUV); ++ av_frame_free(&FrameBufferYUV); + FrameBufferYUV=NULL; + } + FrameBufferYUVReady=false; +@@ -1680,7 +1680,7 @@ void cVideoFile::ReadAudioFrame(bool Pre + int SizeDecoded =(AVCODEC_MAX_AUDIO_FRAME_SIZE*3)/2; + int Len =avcodec_decode_audio3(AudioStream->codec,(int16_t *)BufferToDecode,&SizeDecoded,&PacketTemp); + #else +- AVFrame *Frame =avcodec_alloc_frame(); ++ AVFrame *Frame =av_frame_alloc(); + int SizeDecoded =0; + int Len =avcodec_decode_audio4(AudioStream->codec,Frame,&SizeDecoded,&PacketTemp); + #endif +@@ -1723,7 +1723,7 @@ void cVideoFile::ReadAudioFrame(bool Pre + LastAudioReadedPosition =int(FramePosition*1000); // Keep NextPacketPosition for determine next time if we need to seek + } + #ifndef LIBAV_07 +- av_free(Frame); ++ av_frame_free(&Frame); + #endif + } + } +@@ -1857,9 +1857,9 @@ void cVideoFile::ReadAudioFrame(bool Pre + ToLog(LOGMSG_CRITICAL,QString("Error in cVideoFile::VideoFilter_Open : avfilter_graph_create_filter: src")); + return result; + } +- std::vector<PixelFormat> m_formats; +- m_formats.push_back(PIX_FMT_YUVJ420P); +- m_formats.push_back(PIX_FMT_NONE); /* always add none to get a terminated list in ffmpeg world */ ++ std::vector<AVPixelFormat> m_formats; ++ m_formats.push_back(AV_PIX_FMT_YUVJ420P); ++ m_formats.push_back(AV_PIX_FMT_NONE); /* always add none to get a terminated list in ffmpeg world */ + AVBufferSinkParams *buffersink_params=av_buffersink_params_alloc(); + buffersink_params->pixel_fmts=&m_formats[0]; + #ifdef FF_API_OLD_VSINK_API +@@ -2043,11 +2048,8 @@ void cVideoFile::ReadAudioFrame(bool Pre + return VC_ERROR; + } + while (Ret>=0) { +- AVFilterBufferRef *m_pBufferRef=NULL; +- Ret=av_buffersink_read(VideoFilterOut,&m_pBufferRef); ++ Ret=av_buffersink_get_frame(VideoFilterOut,FrameBufferYUV); + if (Ret<0) break; +- avfilter_copy_buf_props(FrameBufferYUV,m_pBufferRef); +- FrameBufferYUV->opaque=m_pBufferRef; + } + #endif + return VC_BUFFER; +@@ -2212,7 +2219,7 @@ QImage *cVideoFile::ReadVideoFrame(bool + } + + // Allocate structure for YUV image +- if (FrameBufferYUV==NULL) FrameBufferYUV=avcodec_alloc_frame(); ++ if (FrameBufferYUV==NULL) FrameBufferYUV=av_frame_alloc(); + if (FrameBufferYUV==NULL) return NULL; + + bool DataInBuffer =false; +@@ -2281,13 +2288,6 @@ QImage *cVideoFile::ReadVideoFrame(bool + if (av_read_frame(ffmpegVideoFile,StreamPacket)==0) { + + if (StreamPacket->stream_index==VideoStreamNumber) { +- #if LIBAVFILTER_VERSION_INT>=AV_VERSION_INT(3,1,0) +- if (FrameBufferYUV->opaque) { +- avfilter_unref_buffer((AVFilterBufferRef *)FrameBufferYUV->opaque); +- FrameBufferYUV->opaque=NULL; +- } +- #endif +- + int FrameDecoded=0; + if (avcodec_decode_video2(VideoStream->codec,FrameBufferYUV,&FrameDecoded,StreamPacket)<0) + ToLog(LOGMSG_INFORMATION,"IN:cVideoFile::ReadVideoFrame : avcodec_decode_video2 return an error"); +@@ -2380,9 +2380,9 @@ QImage *cVideoFile::ReadVideoFrame(bool + } + + //==================================================================================================================== +-//#define PIXFMT PIX_FMT_BGRA ++//#define PIXFMT AV_PIX_FMT_BGRA + //#define QTPIXFMT QImage::Format_ARGB32_Premultiplied +-#define PIXFMT PIX_FMT_RGB24 ++#define PIXFMT AV_PIX_FMT_RGB24 + #define QTPIXFMT QImage::Format_RGB888 + + QImage *cVideoFile::ConvertYUVToRGB(bool PreviewMode) { +@@ -2401,7 +2401,7 @@ QImage *cVideoFile::ConvertYUVToRGB(bool + //if (PreviewMode && (H>270)) { if ((H==1088)&&(W=1920)) { NewH=271; NewW=480; } else { NewH=270; NewW=NewH*(double(W)/double(H)); } } // H=270 + + QImage RetImage(NewW,NewH,QTPIXFMT); +- AVFrame *FrameBufferRGB =avcodec_alloc_frame(); // Allocate structure for RGB image ++ AVFrame *FrameBufferRGB =av_frame_alloc(); // Allocate structure for RGB image + + if (FrameBufferRGB!=NULL) { + +@@ -2440,7 +2440,7 @@ QImage *cVideoFile::ConvertYUVToRGB(bool + } + + // free FrameBufferRGB because we don't need it in the future +- av_free(FrameBufferRGB); ++ av_frame_free(&FrameBufferRGB); + } + + //return FinalImage; +--- ffdiaporama-1.5.orig/src/engine/cDeviceModelDef.h ++++ ffdiaporama-1.5/src/engine/cDeviceModelDef.h +@@ -57,7 +57,7 @@ extern "C" { + + #include <libavutil/mathematics.h> + #include <libavutil/pixdesc.h> +- #include <libavutil/audioconvert.h> ++ #include <libavutil/channel_layout.h> + + #include <libavcodec/avcodec.h> + +--- ffdiaporama-1.5.orig/src/ffDiaporama/DlgRenderVideo/DlgRenderVideo.cpp ++++ ffdiaporama-1.5/src/ffDiaporama/DlgRenderVideo/DlgRenderVideo.cpp +@@ -1558,12 +1558,12 @@ void DlgRenderVideo::WriteRenderedMusicT + } + + // Init frame +- AVFrame *frame=avcodec_alloc_frame(); ++ AVFrame *frame=av_frame_alloc(); + if (frame->extended_data!=frame->data) { + av_free(frame->extended_data); + frame->extended_data=NULL; + } +- avcodec_get_frame_defaults(frame); ++ av_frame_unref(frame); + frame->nb_samples=WriteWAV->RenderMusic.SoundPacketSize/(WriteWAV->AudioCodecContext->channels*av_get_bytes_per_sample(WriteWAV->AudioCodecContext->sample_fmt)); + + // fill buffer +@@ -1601,7 +1601,7 @@ void DlgRenderVideo::WriteRenderedMusicT + CustomMessageBox(this,QMessageBox::Critical,QApplication::translate("DlgRenderVideo","Render video"),"Error encoding sound!"); + *Continue=false; + } +- av_free(frame); ++ av_frame_free(&frame); + + av_free(PacketSound); + } +--- ffdiaporama-1.5.orig/src/ffDiaporama/mainwindow.cpp ++++ ffdiaporama-1.5/src/ffDiaporama/mainwindow.cpp +@@ -383,9 +383,6 @@ MainWindow::~MainWindow() { + + // Close some libav additionnals + #ifdef LIBAV_08 +- #if defined(VIDEO_LIBAVFILTER) || defined(AUDIO_LIBAVFILTER) +- avfilter_uninit(); +- #endif + avformat_network_deinit(); + #endif + } diff --git a/debian/patches/series b/debian/patches/series index 48238b7..1c92bcb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ fix_hardening_flags.patch libav_0.9.patch libav10.patch +ffmpeg_2.9.patch