From e910250901430bd3dd358ae80843f29bf40b4bd3 Mon Sep 17 00:00:00 2001 From: van Date: Sun, 26 Oct 2008 03:45:51 +0000 Subject: Get rid of the black frame & long silence at the beginning of avi & wmv files that have a non-zero 'start' specified in their header. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1868 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/demuxmpeg.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libhb/demuxmpeg.c') diff --git a/libhb/demuxmpeg.c b/libhb/demuxmpeg.c index a30a15c59..b92a8ded9 100644 --- a/libhb/demuxmpeg.c +++ b/libhb/demuxmpeg.c @@ -211,6 +211,14 @@ int hb_demux_ps( hb_buffer_t * buf_ps, hb_list_t * list_es, hb_psdemux_t* state // for example, ffmpeg. int hb_demux_null( hb_buffer_t * buf_ps, hb_list_t * list_es, hb_psdemux_t* state ) { + // if we don't have a time offset yet, use this timestamp as the offset. + if ( state && state->scr_changes == 0 && + ( buf_ps->start >= 0 || buf_ps->renderOffset >= 0 ) ) + { + ++state->scr_changes; + state->last_scr = buf_ps->start >= 0 ? buf_ps->start : buf_ps->renderOffset; + } + hb_buffer_t *buf = hb_buffer_init( buf_ps->size ); // copy everything from the old to the new except the data ptr & alloc -- cgit v1.2.3