<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[148093] trunk/dports/graphics</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/148093">148093</a></dd>
<dt>Author</dt> <dd>devans@macports.org</dd>
<dt>Date</dt> <dd>2016-04-26 16:13:37 -0700 (Tue, 26 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>OpenSceneGraph, OpenSceneGraph-devel: apply contributed patch for ffmpeg-3.0 compatibility (#51223).</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsgraphicsOpenSceneGraphPortfile">trunk/dports/graphics/OpenSceneGraph/Portfile</a></li>
<li><a href="#trunkdportsgraphicsOpenSceneGraphdevelPortfile">trunk/dports/graphics/OpenSceneGraph-devel/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/graphics/OpenSceneGraph/files/</li>
<li><a href="#trunkdportsgraphicsOpenSceneGraphfilespatchffmpeg30diff">trunk/dports/graphics/OpenSceneGraph/files/patch-ffmpeg-3.0.diff</a></li>
<li>trunk/dports/graphics/OpenSceneGraph-devel/files/</li>
<li><a href="#trunkdportsgraphicsOpenSceneGraphdevelfilespatchffmpeg30diff">trunk/dports/graphics/OpenSceneGraph-devel/files/patch-ffmpeg-3.0.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsgraphicsOpenSceneGraphPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/graphics/OpenSceneGraph/Portfile (148092 => 148093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/graphics/OpenSceneGraph/Portfile        2016-04-26 22:30:13 UTC (rev 148092)
+++ trunk/dports/graphics/OpenSceneGraph/Portfile        2016-04-26 23:13:37 UTC (rev 148093)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> name                    OpenSceneGraph
</span><span class="cx"> conflicts               OpenSceneGraph-devel
</span><span class="cx"> version                 3.4.0
</span><del>-revision                1
</del><ins>+revision                2
</ins><span class="cx"> platforms               darwin
</span><span class="cx"> categories              graphics
</span><span class="cx"> maintainers             nomaintainer
</span><span class="lines">@@ -44,6 +44,8 @@
</span><span class="cx">                         port:boost \
</span><span class="cx">                         port:gstreamer1-gst-plugins-base
</span><span class="cx"> 
</span><ins>+patchfiles              patch-ffmpeg-3.0.diff
+
</ins><span class="cx"> configure.args-append   -DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES \
</span><span class="cx">                         -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
</span><span class="cx">                         -DOSG_WINDOWING_SYSTEM=Cocoa \
</span></span></pre></div>
<a id="trunkdportsgraphicsOpenSceneGraphfilespatchffmpeg30diff"></a>
<div class="addfile"><h4>Added: trunk/dports/graphics/OpenSceneGraph/files/patch-ffmpeg-3.0.diff (0 => 148093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/graphics/OpenSceneGraph/files/patch-ffmpeg-3.0.diff                                (rev 0)
+++ trunk/dports/graphics/OpenSceneGraph/files/patch-ffmpeg-3.0.diff        2016-04-26 23:13:37 UTC (rev 148093)
</span><span class="lines">@@ -0,0 +1,157 @@
</span><ins>+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun &lt;Andreas.Cadhalpun@googlemail.com&gt;
+Last-Update: &lt;2015-11-02&gt;
+
+--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp.orig        2014-11-04 08:29:30.000000000 -0800
++++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp        2016-04-26 14:11:34.000000000 -0700
+@@ -71,7 +71,7 @@
+     findAspectRatio();

+     // Find out whether we support Alpha channel
+-    m_alpha_channel = (m_context-&gt;pix_fmt == PIX_FMT_YUVA420P);
++    m_alpha_channel = (m_context-&gt;pix_fmt == AV_PIX_FMT_YUVA420P);

+     // Find out the framerate
+     #if LIBAVCODEC_VERSION_MAJOR &gt;= 56
+@@ -95,20 +95,19 @@
+         throw std::runtime_error(&quot;avcodec_open() failed&quot;);

+     // Allocate video frame
+-    m_frame.reset(avcodec_alloc_frame());
++    m_frame.reset(av_frame_alloc());

+     // Allocate converted RGB frame
+-    m_frame_rgba.reset(avcodec_alloc_frame());
+-    m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
++    m_frame_rgba.reset(av_frame_alloc());
++    m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height()));
+     m_buffer_rgba[1].resize(m_buffer_rgba[0].size());

+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height());

+     // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame.
+     m_context-&gt;opaque = this;
+-    m_context-&gt;get_buffer = getBuffer;
+-    m_context-&gt;release_buffer = releaseBuffer;
++    m_context-&gt;get_buffer2 = getBuffer;
+ }


+@@ -267,8 +266,8 @@
+ #ifdef USE_SWSCALE
+     if (m_swscale_ctx==0)
+     {
+-        m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
+-                                      src_width, src_height, (PixelFormat) dst_pix_fmt,
++        m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt,
++                                      src_width, src_height, (AVPixelFormat) dst_pix_fmt,
+                                       /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL);
+     }

+@@ -315,14 +314,14 @@
+     AVPicture * const dst = (AVPicture *) m_frame_rgba.get();

+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height());

+     // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine

+-    if (m_context-&gt;pix_fmt == PIX_FMT_YUVA420P)
++    if (m_context-&gt;pix_fmt == AV_PIX_FMT_YUVA420P)
+         yuva420pToRgba(dst, src, width(), height());
+     else
+-        convert(dst, PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width(), height());
++        convert(dst, AV_PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width(), height());

+     // Wait 'delay' seconds before publishing the picture.
+     int i_delay = static_cast&lt;int&gt;(delay * 1000000 + 0.5);
+@@ -349,7 +348,7 @@

+ void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
+ {
+-    convert(dst, PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width, height);
++    convert(dst, AV_PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width, height);

+     const size_t bpp = 4;

+@@ -367,31 +366,28 @@
+     }
+ }

+-
+-
+-int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture)
++int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags)
+ {
++    AVBufferRef *ref;
+     const FFmpegDecoderVideo * const this_ = reinterpret_cast&lt;const FFmpegDecoderVideo*&gt;(context-&gt;opaque);

+-    const int result = avcodec_default_get_buffer(context, picture);
++    const int result = avcodec_default_get_buffer2(context, picture, flags);
+     int64_t * p_pts = reinterpret_cast&lt;int64_t*&gt;( av_malloc(sizeof(int64_t)) );

+     *p_pts = this_-&gt;m_packet_pts;
+     picture-&gt;opaque = p_pts;

++    ref = av_buffer_create((uint8_t *)picture-&gt;opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture-&gt;buf[0], flags);
++    picture-&gt;buf[0] = ref;
++
+     return result;
+ }

+-
+-
+-void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture)
++void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data)
+ {
+-    if (picture != 0)
+-        av_freep(&amp;picture-&gt;opaque);
+-
+-    avcodec_default_release_buffer(context, picture);
++    AVBufferRef *ref = (AVBufferRef *)opaque;
++    av_buffer_unref(&amp;ref);
++    av_free(data);
+ }

+-
+-
+ } // namespace osgFFmpeg
+--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp.orig
++++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
+@@ -94,8 +94,8 @@ private:
+                 int src_pix_fmt, int src_width, int src_height);


+-    static int getBuffer(AVCodecContext * context, AVFrame * picture);
+-    static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
++    static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
++    static void freeBuffer(void * opaque, uint8_t *data);

+     PacketQueue &amp;           m_packets;
+     FFmpegClocks &amp;          m_clocks;
+--- src/osgPlugins/ffmpeg/FFmpegParameters.cpp.orig
++++ src/osgPlugins/ffmpeg/FFmpegParameters.cpp
+@@ -19,7 +19,7 @@ extern &quot;C&quot;
+     #include &lt;libavutil/pixdesc.h&gt;
+ }

+-inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
++inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }


+ namespace osgFFmpeg {
+--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp.orig        2016-02-18 21:25:39.627923629 +0000
++++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp        2016-02-18 21:26:17.071140100 +0000
+@@ -227,8 +227,7 @@
+         if (avcodec_open2(m_context, p_codec, NULL) &lt; 0)
+             throw std::runtime_error(&quot;avcodec_open() failed&quot;);

+-        m_context-&gt;get_buffer = avcodec_default_get_buffer;
+-        m_context-&gt;release_buffer = avcodec_default_release_buffer;
++        m_context-&gt;get_buffer2 = avcodec_default_get_buffer2;

+     }

</ins></span></pre></div>
<a id="trunkdportsgraphicsOpenSceneGraphdevelPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/graphics/OpenSceneGraph-devel/Portfile (148092 => 148093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/graphics/OpenSceneGraph-devel/Portfile        2016-04-26 22:30:13 UTC (rev 148092)
+++ trunk/dports/graphics/OpenSceneGraph-devel/Portfile        2016-04-26 23:13:37 UTC (rev 148093)
</span><span class="lines">@@ -12,6 +12,7 @@
</span><span class="cx"> github.setup            openscenegraph OpenSceneGraph ${git_commit}
</span><span class="cx"> name                    OpenSceneGraph-devel
</span><span class="cx"> version                 3.5.2-${git_date}
</span><ins>+revision                1
</ins><span class="cx"> conflicts               OpenSceneGraph
</span><span class="cx"> platforms               darwin
</span><span class="cx"> categories              graphics
</span><span class="lines">@@ -44,6 +45,8 @@
</span><span class="cx">                         port:boost \
</span><span class="cx">                         port:gstreamer1-gst-plugins-base
</span><span class="cx"> 
</span><ins>+patchfiles              patch-ffmpeg-3.0.diff
+
</ins><span class="cx"> configure.args-append   -DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES \
</span><span class="cx">                         -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
</span><span class="cx">                         -DOSG_WINDOWING_SYSTEM=Cocoa \
</span></span></pre></div>
<a id="trunkdportsgraphicsOpenSceneGraphdevelfilespatchffmpeg30diff"></a>
<div class="addfile"><h4>Added: trunk/dports/graphics/OpenSceneGraph-devel/files/patch-ffmpeg-3.0.diff (0 => 148093)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/graphics/OpenSceneGraph-devel/files/patch-ffmpeg-3.0.diff                                (rev 0)
+++ trunk/dports/graphics/OpenSceneGraph-devel/files/patch-ffmpeg-3.0.diff        2016-04-26 23:13:37 UTC (rev 148093)
</span><span class="lines">@@ -0,0 +1,157 @@
</span><ins>+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun &lt;Andreas.Cadhalpun@googlemail.com&gt;
+Last-Update: &lt;2015-11-02&gt;
+
+--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp.orig        2014-11-04 08:29:30.000000000 -0800
++++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp        2016-04-26 14:11:34.000000000 -0700
+@@ -71,7 +71,7 @@
+     findAspectRatio();

+     // Find out whether we support Alpha channel
+-    m_alpha_channel = (m_context-&gt;pix_fmt == PIX_FMT_YUVA420P);
++    m_alpha_channel = (m_context-&gt;pix_fmt == AV_PIX_FMT_YUVA420P);

+     // Find out the framerate
+     #if LIBAVCODEC_VERSION_MAJOR &gt;= 56
+@@ -95,20 +95,19 @@
+         throw std::runtime_error(&quot;avcodec_open() failed&quot;);

+     // Allocate video frame
+-    m_frame.reset(avcodec_alloc_frame());
++    m_frame.reset(av_frame_alloc());

+     // Allocate converted RGB frame
+-    m_frame_rgba.reset(avcodec_alloc_frame());
+-    m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
++    m_frame_rgba.reset(av_frame_alloc());
++    m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height()));
+     m_buffer_rgba[1].resize(m_buffer_rgba[0].size());

+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height());

+     // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame.
+     m_context-&gt;opaque = this;
+-    m_context-&gt;get_buffer = getBuffer;
+-    m_context-&gt;release_buffer = releaseBuffer;
++    m_context-&gt;get_buffer2 = getBuffer;
+ }


+@@ -267,8 +266,8 @@
+ #ifdef USE_SWSCALE
+     if (m_swscale_ctx==0)
+     {
+-        m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
+-                                      src_width, src_height, (PixelFormat) dst_pix_fmt,
++        m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt,
++                                      src_width, src_height, (AVPixelFormat) dst_pix_fmt,
+                                       /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL);
+     }

+@@ -315,14 +314,14 @@
+     AVPicture * const dst = (AVPicture *) m_frame_rgba.get();

+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &amp;(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height());

+     // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine

+-    if (m_context-&gt;pix_fmt == PIX_FMT_YUVA420P)
++    if (m_context-&gt;pix_fmt == AV_PIX_FMT_YUVA420P)
+         yuva420pToRgba(dst, src, width(), height());
+     else
+-        convert(dst, PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width(), height());
++        convert(dst, AV_PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width(), height());

+     // Wait 'delay' seconds before publishing the picture.
+     int i_delay = static_cast&lt;int&gt;(delay * 1000000 + 0.5);
+@@ -349,7 +348,7 @@

+ void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
+ {
+-    convert(dst, PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width, height);
++    convert(dst, AV_PIX_FMT_RGB24, src, m_context-&gt;pix_fmt, width, height);

+     const size_t bpp = 4;

+@@ -367,31 +366,28 @@
+     }
+ }

+-
+-
+-int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture)
++int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags)
+ {
++    AVBufferRef *ref;
+     const FFmpegDecoderVideo * const this_ = reinterpret_cast&lt;const FFmpegDecoderVideo*&gt;(context-&gt;opaque);

+-    const int result = avcodec_default_get_buffer(context, picture);
++    const int result = avcodec_default_get_buffer2(context, picture, flags);
+     int64_t * p_pts = reinterpret_cast&lt;int64_t*&gt;( av_malloc(sizeof(int64_t)) );

+     *p_pts = this_-&gt;m_packet_pts;
+     picture-&gt;opaque = p_pts;

++    ref = av_buffer_create((uint8_t *)picture-&gt;opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture-&gt;buf[0], flags);
++    picture-&gt;buf[0] = ref;
++
+     return result;
+ }

+-
+-
+-void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture)
++void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data)
+ {
+-    if (picture != 0)
+-        av_freep(&amp;picture-&gt;opaque);
+-
+-    avcodec_default_release_buffer(context, picture);
++    AVBufferRef *ref = (AVBufferRef *)opaque;
++    av_buffer_unref(&amp;ref);
++    av_free(data);
+ }

+-
+-
+ } // namespace osgFFmpeg
+--- src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp.orig
++++ src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
+@@ -94,8 +94,8 @@ private:
+                 int src_pix_fmt, int src_width, int src_height);


+-    static int getBuffer(AVCodecContext * context, AVFrame * picture);
+-    static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
++    static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
++    static void freeBuffer(void * opaque, uint8_t *data);

+     PacketQueue &amp;           m_packets;
+     FFmpegClocks &amp;          m_clocks;
+--- src/osgPlugins/ffmpeg/FFmpegParameters.cpp.orig
++++ src/osgPlugins/ffmpeg/FFmpegParameters.cpp
+@@ -19,7 +19,7 @@ extern &quot;C&quot;
+     #include &lt;libavutil/pixdesc.h&gt;
+ }

+-inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
++inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }


+ namespace osgFFmpeg {
+--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp.orig        2016-02-18 21:25:39.627923629 +0000
++++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp        2016-02-18 21:26:17.071140100 +0000
+@@ -227,8 +227,7 @@
+         if (avcodec_open2(m_context, p_codec, NULL) &lt; 0)
+             throw std::runtime_error(&quot;avcodec_open() failed&quot;);

+-        m_context-&gt;get_buffer = avcodec_default_get_buffer;
+-        m_context-&gt;release_buffer = avcodec_default_release_buffer;
++        m_context-&gt;get_buffer2 = avcodec_default_get_buffer2;

+     }

</ins></span></pre>
</div>
</div>

</body>
</html>