Discard packets with crazy (very negative) timestamps.
authorCarl Hetherington <cth@carlh.net>
Mon, 19 Sep 2016 22:32:13 +0000 (23:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 19 Sep 2016 22:32:13 +0000 (23:32 +0100)
src/lib/ffmpeg_decoder.cc

index ace54f7194a3eaffd0cd13f984e80af97e0be12e..a0965dcfb81a917eef2e0ba46b1223d536f35cc6 100644 (file)
@@ -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);
                        }
                }