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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 8184003: Fix hangs & crashes in teardown-during-Seek. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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/base/composite_filter.cc ('k') | media/filters/ffmpeg_video_decoder.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 56981e4710f59e92d4139c7421d9860bbf6e9546..f59c665a0ed35d73fea6e9fa8c34e02b86108bd6 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -10,6 +10,7 @@
#include "base/stl_util.h"
#include "base/string_util.h"
#include "base/time.h"
+#include "media/base/data_buffer.h"
#include "media/base/filter_host.h"
#include "media/base/limits.h"
#include "media/base/media_switches.h"
@@ -139,6 +140,10 @@ void FFmpegDemuxerStream::Stop() {
DCHECK_EQ(MessageLoop::current(), demuxer_->message_loop());
base::AutoLock auto_lock(lock_);
buffer_queue_.clear();
+ for (ReadQueue::iterator it = read_queue_.begin();
+ it != read_queue_.end(); ++it) {
+ it->Run(new DataBuffer(0));
+ }
read_queue_.clear();
stopped_ = true;
}
@@ -289,13 +294,13 @@ FFmpegDemuxer::~FFmpegDemuxer() {
void FFmpegDemuxer::PostDemuxTask() {
message_loop_->PostTask(FROM_HERE,
- base::Bind(&FFmpegDemuxer::DemuxTask, this));
+ base::Bind(&FFmpegDemuxer::DemuxTask, this));
}
void FFmpegDemuxer::Stop(const base::Closure& callback) {
// Post a task to notify the streams to stop as well.
message_loop_->PostTask(FROM_HERE,
- base::Bind(&FFmpegDemuxer::StopTask, this, callback));
+ base::Bind(&FFmpegDemuxer::StopTask, this, callback));
// Then wakes up the thread from reading.
SignalReadCompleted(DataSource::kReadError);
@@ -303,7 +308,7 @@ void FFmpegDemuxer::Stop(const base::Closure& callback) {
void FFmpegDemuxer::Seek(base::TimeDelta time, const FilterStatusCB& cb) {
message_loop_->PostTask(FROM_HERE,
- base::Bind(&FFmpegDemuxer::SeekTask, this, time, cb));
+ base::Bind(&FFmpegDemuxer::SeekTask, this, time, cb));
}
void FFmpegDemuxer::SetPlaybackRate(float playback_rate) {
@@ -317,8 +322,8 @@ void FFmpegDemuxer::SetPreload(Preload preload) {
}
void FFmpegDemuxer::OnAudioRendererDisabled() {
- message_loop_->PostTask(FROM_HERE,
- base::Bind(&FFmpegDemuxer::DisableAudioStreamTask, this));
+ message_loop_->PostTask(FROM_HERE, base::Bind(
+ &FFmpegDemuxer::DisableAudioStreamTask, this));
}
void FFmpegDemuxer::set_host(FilterHost* filter_host) {
@@ -473,7 +478,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source,
AVStream* stream = format_context_->streams[i];
// WebM is currently strictly VP8 and Vorbis.
if (kDemuxerIsWebm && (stream->codec->codec_id != CODEC_ID_VP8 &&
- stream->codec->codec_id != CODEC_ID_VORBIS)) {
+ stream->codec->codec_id != CODEC_ID_VORBIS)) {
packet_streams_.push_back(NULL);
continue;
}
@@ -487,7 +492,7 @@ void FFmpegDemuxer::InitializeTask(DataSource* data_source,
if (stream->first_dts != static_cast<int64_t>(AV_NOPTS_VALUE)) {
const base::TimeDelta first_dts = ConvertFromTimeBase(
- stream->time_base, stream->first_dts);
+ stream->time_base, stream->first_dts);
if (start_time_ == kNoTimestamp || first_dts < start_time_)
start_time_ = first_dts;
}
« no previous file with comments | « media/base/composite_filter.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698