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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2546263002: media: Continue aborting FFMpegDemuxerStream::Read() calls until Seek(). (Closed)
Patch Set: return Created 4 years 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_demuxer.h ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 093e4f539b13847a1f7f6beb0e140674af037f69..eab193e465a4188e0e1fba6c9c2ae4735a78e78a 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -275,6 +275,7 @@ FFmpegDemuxerStream::FFmpegDemuxerStream(
video_rotation_(VIDEO_ROTATION_0),
is_enabled_(true),
waiting_for_keyframe_(false),
+ aborted_(false),
fixup_negative_timestamps_(false) {
DCHECK(demuxer_);
@@ -591,9 +592,11 @@ void FFmpegDemuxerStream::FlushBuffers() {
end_of_stream_ = false;
last_packet_timestamp_ = kNoTimestamp;
last_packet_duration_ = kNoTimestamp;
+ aborted_ = false;
}
void FFmpegDemuxerStream::Abort() {
+ aborted_ = true;
if (!read_cb_.is_null())
base::ResetAndReturn(&read_cb_).Run(DemuxerStream::kAborted, nullptr);
}
@@ -641,6 +644,11 @@ void FFmpegDemuxerStream::Read(const ReadCB& read_cb) {
return;
}
+ if (aborted_) {
+ base::ResetAndReturn(&read_cb_).Run(kAborted, nullptr);
+ return;
+ }
+
SatisfyPendingRead();
}
« no previous file with comments | « media/filters/ffmpeg_demuxer.h ('k') | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698