Index: media/filters/ffmpeg_video_decoder.cc |
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc |
index 606968b2141269ab1262ea9d3e5dbe8ad5d57d6b..189c16efaf90be667541cd3286a34f8b30934fbc 100644 |
--- a/media/filters/ffmpeg_video_decoder.cc |
+++ b/media/filters/ffmpeg_video_decoder.cc |
@@ -102,8 +102,8 @@ |
} |
static void ReleaseVideoBufferImpl(void* opaque, uint8_t* data) { |
- if (opaque) |
- static_cast<VideoFrame*>(opaque)->Release(); |
+ scoped_refptr<VideoFrame> video_frame; |
+ video_frame.swap(reinterpret_cast<VideoFrame**>(&opaque)); |
} |
// static |
@@ -206,8 +206,8 @@ |
// Now create an AVBufferRef for the data just allocated. It will own the |
// reference to the VideoFrame object. |
- VideoFrame* opaque = video_frame.get(); |
- opaque->AddRef(); |
+ void* opaque = NULL; |
+ video_frame.swap(reinterpret_cast<VideoFrame**>(&opaque)); |
frame->buf[0] = |
av_buffer_create(frame->data[0], |
VideoFrame::AllocationSize(format, coded_size), |