Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1240)

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 2732063005: Revert of Remove a scoped_refptr<>::swap overload (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698