From 70ae69648d248a5ac9e54abd640e1c80570473a7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Jun 2013 09:12:58 +0000 Subject: [PATCH] From Nick Black, "Hey there! avcodec_open() has been deprecated for some time, and indeed has been removed in the most recent versions of libavcodec/ffmpeg. You're already using avcodec_open2() elsewhere, but one appears to have been missed. The change is trivial: [skynet](0) $ svn diff Index: src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp =================================================================== --- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (revision 13355) +++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (working copy) @@ -109,7 +109,7 @@ // m_context->flags |= CODEC_FLAG_TRUNCATED; // Open codec - if (avcodec_open(m_context, p_codec) < 0) + if (avcodec_open2(m_context, p_codec, NULL) < 0) throw std::runtime_error("avcodec_open() failed"); } [skynet](0) $ I've applied similar changes this year to many other packages, including cheese, blender, linphone, ad nauseam. It's been tested by verifying that with my patch, OSG builds against the newest libavcodec and ffmpeg, whereas otherwise it does not. The modified src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp is attached. It originates in svn trunk revision 13355. Thanks!" --- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp index 90b4a4d45..7a36d9c0e 100644 --- a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp +++ b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp @@ -109,7 +109,7 @@ void FFmpegDecoderAudio::open(AVStream * const stream) // m_context->flags |= CODEC_FLAG_TRUNCATED; // Open codec - if (avcodec_open(m_context, p_codec) < 0) + if (avcodec_open2(m_context, p_codec, NULL) < 0) throw std::runtime_error("avcodec_open() failed"); }