diff options
author | jstebbins <[email protected]> | 2009-08-09 16:51:44 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2009-08-09 16:51:44 +0000 |
commit | e0da9d994d25f017b54e82fcd97cbd5aa9097e08 (patch) | |
tree | 53e186ea6da2b5c85e69c6c8e8eee55134bf248e | |
parent | 8306e8da55ce41e0ad6b799a165a4912872dac57 (diff) |
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
-rw-r--r-- | libhb/stream.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, |