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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2822063002: Media: Reject negative initial video timestamps in FFmpegDemuxer. (Closed)
Patch Set: Refine failure condition. Created 3 years, 8 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 | no next file » | 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 5f37c6eac83c2db9ea5408714e3a1d5c3c4bec89..e2a70731fe4c5e256cee22485f351b58bf0370ae 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -507,7 +507,8 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
// Only allow negative timestamps past if we know they'll be fixed up by the
// code paths below; otherwise they should be treated as a parse error.
- if (!fixup_negative_timestamps_ && buffer->timestamp() < base::TimeDelta()) {
+ if ((!fixup_negative_timestamps_ || last_packet_timestamp_ == kNoTimestamp) &&
+ buffer->timestamp() < base::TimeDelta()) {
MEDIA_LOG(DEBUG, media_log_)
<< "FFmpegDemuxer: unfixable negative timestamp";
demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698