summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demuxer.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-24 20:46:54 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-25 22:48:10 +0300
commit05ae9dbd0dcc4fcce02a97011a46d89dab860021 (patch)
treef839629bcb07817af7b52f96fcd5d592b3b34c81 /libmpdemux/demuxer.c
parentdd1760e697f38a13f05d2d8563598a2e6ed0a84f (diff)
downloadmpv-05ae9dbd0dcc4fcce02a97011a46d89dab860021.tar.bz2
mpv-05ae9dbd0dcc4fcce02a97011a46d89dab860021.tar.xz
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).
Diffstat (limited to 'libmpdemux/demuxer.c')
-rw-r--r--libmpdemux/demuxer.c4
1 files changed, 2 insertions, 2 deletions
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;