From 6fec4838373fd50520a2499ff143c50e5d323f9f Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sat, 18 Feb 2017 14:11:17 -0700 Subject: sync: fix sync problem with delayed streams If a stream is delayed by a large amount and the first timestamp from the stream is AV_NOPTS_VALUE, sync assumed a 0 timestamp which caused loss of sync. Drop the buffer instead. --- libhb/sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libhb/sync.c') diff --git a/libhb/sync.c b/libhb/sync.c index 9bc94de02..f199feff8 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -1761,12 +1761,12 @@ static int UpdateSCR( sync_stream_t * stream, hb_buffer_t * buf ) { // This should happen extremely rarely if ever. // But if we get here, this is the first buffer received for - // this stream. Normally, some buffers will be queued for + // this stream. Normally, some buffers will be queued for // every stream before we ever call UpdateSCR. - // We don't really know what it's timestamp should be, - // but 0 is a good guess. - buf->s.start = 0; - last_scr_pts = buf->s.start; + // We don't really know what it's timestamp should be. + // So drop the buffer. + hb_buffer_close(&buf); + return 0; } if (buf->s.stop != AV_NOPTS_VALUE) { -- cgit v1.2.3