summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorRicardo Constantino <wiiaboo@gmail.com>2017-03-29 02:16:11 +0100
committerRicardo Constantino <wiiaboo@gmail.com>2017-03-29 02:19:09 +0100
commit4d07fce04175bf353e8de538571d3afa2c7b3e00 (patch)
tree53aeda787f1b523e150078d637e44bc4d0a85f8f /stream
parent7fe7583a7f56626a57ea181bd213064374738c27 (diff)
downloadmpv-4d07fce04175bf353e8de538571d3afa2c7b3e00.tar.bz2
mpv-4d07fce04175bf353e8de538571d3afa2c7b3e00.tar.xz
stream/stream_dvdnav: show list of titles on verbose
Same as stream_bluray, but only if no title is selected already.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvdnav.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index e4516fc295..fc7ddfdc58 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -473,6 +473,7 @@ static int open_s_internal(stream_t *stream)
int best_title = -1;
int32_t num_titles;
if (dvdnav_get_number_of_titles(dvdnav, &num_titles) == DVDNAV_STATUS_OK) {
+ MP_VERBOSE(stream, "List of available titles:\n");
for (int n = 1; n <= num_titles; n++) {
uint64_t *parts = NULL, duration = 0;
dvdnav_describe_title_chapters(dvdnav, n, &parts, &duration);
@@ -481,6 +482,12 @@ static int open_s_internal(stream_t *stream)
best_length = duration;
best_title = n;
}
+ if (duration > 90000) { // arbitrarily ignore <1s titles
+ char *time = mp_format_time(duration / 90000, false);
+ MP_VERBOSE(stream, "title: %3d duration: %s\n",
+ n - 1, time);
+ talloc_free(time);
+ }
free(parts);
}
}