summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-09-19 23:32:13 +0100
committerCarl Hetherington <cth@carlh.net>2016-09-19 23:32:13 +0100
commit466524e5991cb51dd9c961eac4cb9c0d051938d4 (patch)
treec1bad08cd59461046977b1cad5c5c41d7b040530 /src/lib/ffmpeg_decoder.cc
parentb65ce7631f7beea66bc4639e3de9e4aa8201a44d (diff)
Discard packets with crazy (very negative) timestamps.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index ace54f719..a0965dcfb 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -421,7 +421,8 @@ FFmpegDecoder::decode_audio_packet ()
ct += ContentTime::from_frames (remove, (*stream)->frame_rate ());
}
- if (data->frames() > 0) {
+ /* Give this data provided there is some, and its time is sane */
+ if (ct >= ContentTime() && data->frames() > 0) {
audio->give (*stream, data, ct);
}
}