From 8ac84c814d72983be3d3037c2b5491d2e3ea8832 Mon Sep 17 00:00:00 2001 From: van Date: Sat, 9 May 2009 20:49:00 +0000 Subject: Fix another subtitle interleaving botch - for mkv's we want the subtitle in the cluster where it starts, not the cluster where it ends. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2409 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/muxcommon.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libhb/muxcommon.c') diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c index 4d64b76f4..ea0104376 100644 --- a/libhb/muxcommon.c +++ b/libhb/muxcommon.c @@ -141,6 +141,12 @@ static hb_buffer_t *mf_pull( hb_track_t *track ) return b; } +static hb_buffer_t *mf_peek( hb_track_t *track ) +{ + return track->mf.out == track->mf.in ? + NULL : track->mf.fifo[track->mf.out & (track->mf.flen - 1)]; +} + static void MoveToInternalFifos( hb_mux_t *mux ) { int i; @@ -188,18 +194,12 @@ static void OutputTrackChunk( hb_mux_t *mux, hb_track_t *track, hb_mux_object_t { hb_buffer_t *buf; - while ( ( buf = mf_pull( track ) ) != NULL ) + while ( ( buf = mf_peek( track ) ) != NULL && buf->start < mux->pts ) { - m->mux( m, track->mux_data, buf ); + m->mux( m, track->mux_data, mf_pull( track ) ); track->frames += 1; track->bytes += buf->size; - - uint64_t pts = buf->stop; hb_buffer_close( &buf ); - if ( pts >= mux->pts ) - { - break; - } } } -- cgit v1.2.3