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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2563183002: Fix up missing timestamps in FFmpegDemuxer. (Closed)
Patch Set: added demuxer status to media log Created 4 years 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
« media/filters/ffmpeg_demuxer.h ('K') | « media/filters/ffmpeg_demuxer.h ('k') | 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 0c532d0edb1a84a026487497e29bdc7a5f10bb93..31c706ebf9824e439aa92711d0167848fe38006a 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -553,9 +553,14 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
: base::TimeDelta::FromMicroseconds(1)));
}
+ if (buffer->timestamp() == kNoTimestamp) {
+ // If we didn't get a valid timestamp and didn't fix it up, then fail.
+ demuxer_->NotifyDemuxerError(DEMUXER_ERROR_COULD_NOT_PARSE);
+ return;
+ }
+
// The demuxer should always output positive timestamps.
DCHECK(buffer->timestamp() >= base::TimeDelta());
- DCHECK(buffer->timestamp() != kNoTimestamp);
if (last_packet_timestamp_ < buffer->timestamp()) {
buffered_ranges_.Add(last_packet_timestamp_, buffer->timestamp());
@@ -1802,6 +1807,12 @@ void FFmpegDemuxer::OnDataSourceError() {
host_->OnDemuxerError(PIPELINE_ERROR_READ);
}
+void FFmpegDemuxer::NotifyDemuxerError(PipelineStatus status) {
+ MEDIA_LOG(ERROR, media_log_) << GetDisplayName()
+ << ": demuxer error: " << status;
+ host_->OnDemuxerError(status);
+}
+
void FFmpegDemuxer::SetLiveness(DemuxerStream::Liveness liveness) {
DCHECK(task_runner_->BelongsToCurrentThread());
for (const auto& stream : streams_) {
« media/filters/ffmpeg_demuxer.h ('K') | « media/filters/ffmpeg_demuxer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698