| Index: media/filters/ffmpeg_demuxer.cc
|
| diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
|
| index de1968afc43d200f86f0eeb3791621ce72d54d72..d54db072725801e754db463d2a00b5f299d2cf94 100644
|
| --- a/media/filters/ffmpeg_demuxer.cc
|
| +++ b/media/filters/ffmpeg_demuxer.cc
|
| @@ -34,6 +34,22 @@
|
|
|
| namespace media {
|
|
|
| +static base::Time ExtractTimelineOffset(AVFormatContext* format_context) {
|
| + if (strstr(format_context->iformat->name, "webm") ||
|
| + strstr(format_context->iformat->name, "matroska")) {
|
| + const AVDictionaryEntry* entry =
|
| + av_dict_get(format_context->metadata, "creation_time", NULL, 0);
|
| +
|
| + base::Time timeline_offset;
|
| + if (entry != NULL && entry->value != NULL &&
|
| + FFmpegUTCDateToTime(entry->value, &timeline_offset)) {
|
| + return timeline_offset;
|
| + }
|
| + }
|
| +
|
| + return base::Time();
|
| +}
|
| +
|
| //
|
| // FFmpegDemuxerStream
|
| //
|
| @@ -486,6 +502,10 @@ base::TimeDelta FFmpegDemuxer::GetStartTime() const {
|
| return start_time_;
|
| }
|
|
|
| +base::Time FFmpegDemuxer::GetTimelineOffset() const {
|
| + return timeline_offset_;
|
| +}
|
| +
|
| void FFmpegDemuxer::AddTextStreams() {
|
| DCHECK(task_runner_->BelongsToCurrentThread());
|
|
|
| @@ -674,6 +694,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
|
| if (strcmp(format_context->iformat->name, "avi") == 0)
|
| format_context->flags |= AVFMT_FLAG_GENPTS;
|
|
|
| + timeline_offset_ = ExtractTimelineOffset(format_context);
|
| +
|
| // Good to go: set the duration and bitrate and notify we're done
|
| // initializing.
|
| host_->SetDuration(max_duration);
|
|
|