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

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 2723083004: Remove a scoped_refptr<>::swap overload (Closed)
Patch Set: avoid to use std::swap 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 189c16efaf90be667541cd3286a34f8b30934fbc..606968b2141269ab1262ea9d3e5dbe8ad5d57d6b 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -102,8 +102,8 @@ static int GetVideoBufferImpl(struct AVCodecContext* s,
}
static void ReleaseVideoBufferImpl(void* opaque, uint8_t* data) {
- scoped_refptr<VideoFrame> video_frame;
- video_frame.swap(reinterpret_cast<VideoFrame**>(&opaque));
+ if (opaque)
+ static_cast<VideoFrame*>(opaque)->Release();
}
// static
@@ -206,8 +206,8 @@ int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
// Now create an AVBufferRef for the data just allocated. It will own the
// reference to the VideoFrame object.
- void* opaque = NULL;
- video_frame.swap(reinterpret_cast<VideoFrame**>(&opaque));
+ VideoFrame* opaque = video_frame.get();
+ opaque->AddRef();
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