summaryrefslogtreecommitdiffstats
path: root/libhb/demuxmpeg.c
diff options
context:
space:
mode:
authorvan <[email protected]>2008-10-26 03:45:51 +0000
committervan <[email protected]>2008-10-26 03:45:51 +0000
commite910250901430bd3dd358ae80843f29bf40b4bd3 (patch)
tree201846a78bcd6d795ecb9aca6010ce06a549e6ed /libhb/demuxmpeg.c
parenteac5404f25a729ffef6aeb92fa379db76badb1a4 (diff)
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
Diffstat (limited to 'libhb/demuxmpeg.c')
-rw-r--r--libhb/demuxmpeg.c8
1 files changed, 8 insertions, 0 deletions
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