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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 353163004: Fix missing seek information when video has no start time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | 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 92c438ea3a7dfea48b5674c50fccf4014aba73a9..dcc178469e3bec2be3ca2838269e174465507964 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -772,7 +772,16 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
const base::TimeDelta start_time =
ExtractStartTime(stream, start_time_estimates[i]);
- if (start_time == kNoTimestamp())
+ const bool has_start_time = start_time != kNoTimestamp();
+
+ // Always prefer the video stream for seeking. If none exists, we'll swap
+ // the fallback stream with the preferred stream below.
+ if (codec_type == AVMEDIA_TYPE_VIDEO) {
+ preferred_stream_for_seeking_ =
+ StreamSeekInfo(i, has_start_time ? start_time : base::TimeDelta());
+ }
+
+ if (!has_start_time)
continue;
if (start_time < start_time_) {
@@ -780,13 +789,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
// Choose the stream with the lowest starting time as the fallback stream
// for seeking. Video should always be preferred.
- fallback_stream_for_seeking_ = std::make_pair(i, start_time);
+ fallback_stream_for_seeking_ = StreamSeekInfo(i, start_time);
}
-
- // Always prefer the video stream for seeking. If none exists, we'll swap
- // the fallback stream with the preferred stream below.
- if (codec_type == AVMEDIA_TYPE_VIDEO)
- preferred_stream_for_seeking_ = std::make_pair(i, start_time);
}
if (!audio_stream && !video_stream) {
@@ -814,7 +818,7 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb,
// put timestamps on its frames.
if (start_time_ == kInfiniteDuration()) {
start_time_ = base::TimeDelta();
- preferred_stream_for_seeking_ = std::make_pair(
+ preferred_stream_for_seeking_ = StreamSeekInfo(
video_stream ? video_stream->index : audio_stream->index, start_time_);
} else if (!video_stream) {
// If no video stream exists, use the audio or text stream found above.
« no previous file with comments | « no previous file | media/filters/ffmpeg_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698