From fb6481ecb5e3a950fbec3ae76ad29352576b2aaf Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Mon, 16 Jan 2017 15:47:13 +0000 Subject: stream_bluray: use proper 0-based idx Even though the title list code was copied from FFmpeg/libbluray, I didn't check that mpv used 0-based title indexing. $ mpv bd://1 --bluray-device=. --msg-level=bd=v [bd] Opening bd:// [bd] List of available titles: [bd] idx: 1 duration: 00:00:36 (playlist: 00000.mpls) [bd] idx: 2 duration: 01:31:30 (playlist: 00001.mpls) [bd] idx: 3 duration: 00:00:50 (playlist: 00003.mpls) bd://1 actually opens idx 2 from the list, not 1. bd://mpls/1 opens playlist 00001.mpls as expected. With this commit: $ mpv bd://1 --bluray-device=. --msg-level=bd=v [bd] Opening bd:// [bd] List of available titles: [bd] idx: 0 duration: 00:00:36 (playlist: 00000.mpls) [bd] idx: 1 duration: 01:31:30 (playlist: 00001.mpls) [bd] idx: 2 duration: 00:00:50 (playlist: 00003.mpls) should play the expected idx 1. --- stream/stream_bluray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index 5f083954c2..e648337b93 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -425,7 +425,7 @@ static int bluray_stream_open_internal(stream_t *s) char *time = mp_format_time(ti->duration / 90000, false); MP_VERBOSE(s, "idx: %3d duration: %s (playlist: %05d.mpls)\n", - i + 1, time, ti->playlist); + i, time, ti->playlist); talloc_free(time); /* try to guess which title may contain the main movie */ -- cgit v1.2.3