From 324119a5be8207ae85aa05c238bb70590d7a681e Mon Sep 17 00:00:00 2001 From: ddennedy Date: Mon, 20 Oct 2008 23:26:39 +0000 Subject: [PATCH] producer_avformat.c: bugfix Ogg Vorbis files and possibly others that report invalid pts on some packets git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1188 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/avformat/producer_avformat.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 0b9fdb2..909d424 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -989,9 +989,12 @@ static int producer_get_audio( mlt_frame frame, int16_t **buffer, mlt_audio_form } // If we're behind, ignore this packet - float current_pts = av_q2d( stream->time_base ) * pkt.pts; - if ( seekable && ( !ignore && current_pts <= ( real_timecode - 0.02 ) ) ) - ignore = 1; + if ( pkt.pts >= 0 ) + { + float current_pts = av_q2d( stream->time_base ) * pkt.pts; + if ( seekable && ( !ignore && current_pts <= ( real_timecode - 0.02 ) ) ) + ignore = 1; + } } // We're finished with this packet regardless -- 1.7.4.4