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://localhost/HandBrake/trunk@2757
b64f7644-9d1e-0410-96f1-
a4d463321fa5
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,