From e0da9d994d25f017b54e82fcd97cbd5aa9097e08 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Sun, 9 Aug 2009 16:51:44 +0000 Subject: libhb: don't truncate last chapter of a stream When an ffmpeg stream doesn't have chapters, we insert a dummy chapter into our chapter list that has the same duration as the title. But the title duration is only a guess. Later, when the chapter end time is reached, we increment the chapter number. In the reader, we exit if the current chapter number is greater than the last chapter. This patch only increments the chapter number in stream if there is actually another chapter. This way reader will continue till the file is exhausted git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2757 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libhb') diff --git a/libhb/stream.c b/libhb/stream.c index 9c0349096..8aa61a181 100644 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -2900,9 +2900,10 @@ static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf ) if ( buf->id == stream->ffmpeg_video_id && buf->start >= stream->chapter_end ) { hb_chapter_t *chapter = hb_list_item( stream->title->list_chapter, - ++stream->chapter ); + stream->chapter+1 ); if( chapter ) { + stream->chapter++; stream->chapter_end += chapter->duration; buf->new_chap = stream->chapter + 1; hb_deep_log( 2, "ffmpeg_read starting chapter %i at %"PRId64, -- cgit v1.2.3