From 05ae9dbd0dcc4fcce02a97011a46d89dab860021 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 24 Apr 2010 20:46:54 +0300 Subject: Fix chapter handling with first chapter not at beginning of file Before "-chapter 1" did nothing even if the first chapter didn't start at the beginning of file. Fix it. Before all chapter property commands (including chapter seek keys) failed if the current playback position was before the start of the first chapter. Now they'll work. Relative chapter seeks will go to the first chapter (even if that's in the wrong direction for backward seeks). --- libmpdemux/demuxer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmpdemux/demuxer.c') diff --git a/libmpdemux/demuxer.c b/libmpdemux/demuxer.c index 0f026dffd6..551fd330c4 100644 --- a/libmpdemux/demuxer.c +++ b/libmpdemux/demuxer.c @@ -1529,11 +1529,11 @@ int demuxer_seek_chapter(demuxer_t *demuxer, int chapter, double *seek_pts, int demuxer_get_current_chapter(demuxer_t *demuxer) { - int chapter = -1; + int chapter = -2; if (!demuxer->num_chapters || !demuxer->chapters) { if (stream_control(demuxer->stream, STREAM_CTRL_GET_CURRENT_CHAPTER, &chapter) == STREAM_UNSUPPORTED) - chapter = -1; + chapter = -2; } else { sh_video_t *sh_video = demuxer->video->sh; sh_audio_t *sh_audio = demuxer->audio->sh; -- cgit v1.2.3