Index: media/filters/gpu_video_decoder.cc |
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc |
index 27b6aabb8d1eab8e795ab1cb3e7a285297965953..40af5a3b777904ce9d179dca9dfa5d7eb019ec19 100644 |
--- a/media/filters/gpu_video_decoder.cc |
+++ b/media/filters/gpu_video_decoder.cc |
@@ -115,18 +115,7 @@ void GpuVideoDecoder::Stop(const base::Closure& closure) { |
void GpuVideoDecoder::Initialize(const scoped_refptr<DemuxerStream>& stream, |
const PipelineStatusCB& orig_status_cb, |
const StatisticsCB& statistics_cb) { |
- const VideoDecoderConfig& config = stream->video_decoder_config(); |
if (!gvd_loop_proxy_) { |
- // FFmpegDemuxer's destructor frees/clears the AVStream underpinnings of |
- // FFmpegDemuxerStream without notifying the stream, creating a race between |
- // initialization and teardown. As a HACK until this is fixed, enable |
- // the bitstream converter before posting the Initialize() call to the video |
- // decoder thread since we know the DemuxerStream is valid at this point. |
- // See http://crbug.com/143460 for more detail. |
- // TODO(fischman): drop this hack! |
- if (config.IsValidConfig() && config.codec() == kCodecH264) |
- stream->EnableBitstreamConverter(); |
- |
gvd_loop_proxy_ = base::ResetAndReturn(&message_loop_factory_cb_).Run(); |
gvd_loop_proxy_->PostTask(FROM_HERE, base::Bind( |
&GpuVideoDecoder::Initialize, |
@@ -146,6 +135,7 @@ void GpuVideoDecoder::Initialize(const scoped_refptr<DemuxerStream>& stream, |
// TODO(scherkus): this check should go in Pipeline prior to creating |
// decoder objects. |
+ const VideoDecoderConfig& config = stream->video_decoder_config(); |
if (!config.IsValidConfig()) { |
DLOG(ERROR) << "Invalid video stream - " << config.AsHumanReadableString(); |
status_cb.Run(PIPELINE_ERROR_DECODE); |
@@ -159,6 +149,9 @@ void GpuVideoDecoder::Initialize(const scoped_refptr<DemuxerStream>& stream, |
return; |
} |
+ if (config.codec() == kCodecH264) |
+ stream->EnableBitstreamConverter(); |
+ |
demuxer_stream_ = stream; |
statistics_cb_ = statistics_cb; |