Skip to content

Commit

Permalink
stream/stream_bluray: display list of available titles on verbose
Browse files Browse the repository at this point in the history
Based on similar code on FFmpeg and libbluray's list_titles example.
  • Loading branch information
wiiaboo authored and wm4 committed Aug 11, 2016
1 parent 8719096 commit 5d74ba9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stream/stream_bluray.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,19 @@ static int bluray_stream_open(stream_t *s)
return STREAM_UNSUPPORTED;
}

MP_VERBOSE(s, "List of available titles:\n");

/* parse titles information */
uint64_t max_duration = 0;
for (int i = 0; i < b->num_titles; i++) {
BLURAY_TITLE_INFO *ti = bd_get_title_info(bd, i, 0);
if (!ti)
continue;

MP_VERBOSE(s, "idx: %3d duration: %s (playlist: %05d.mpls)\n",
i + 1, mp_format_time(ti->duration / 90000, false),
ti->playlist);

/* try to guess which title may contain the main movie */
if (ti->duration > max_duration) {
max_duration = ti->duration;
Expand Down

0 comments on commit 5d74ba9

Please sign in to comment.