diff options
author | thewisenerd <thewisenerd@protonmail.com> | 2018-10-21 20:16:54 +0530 |
---|---|---|
committer | wm4 <1387750+wm4@users.noreply.github.com> | 2019-09-21 15:41:22 +0200 |
commit | 8f35b3873f5d99120ac8edec8f36d393f8a81b11 (patch) | |
tree | eb03e30b9ad4675b15474b59b2cb008df27e0313 /player/loadfile.c | |
parent | 2a29950020af1cb3d1e0c81c6cf720d308d20eaf (diff) | |
download | mpv-8f35b3873f5d99120ac8edec8f36d393f8a81b11.tar.bz2 mpv-8f35b3873f5d99120ac8edec8f36d393f8a81b11.tar.xz |
player: use track title if exists instead of filename
Diffstat (limited to 'player/loadfile.c')
-rw-r--r-- | player/loadfile.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/player/loadfile.c b/player/loadfile.c index a72e34565a..47b3d7a66e 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -779,7 +779,11 @@ int mp_add_external_file(struct MPContext *mpctx, char *filename, struct sh_stream *sh = demux_get_stream(demuxer, n); struct track *t = add_stream_track(mpctx, demuxer, sh); t->is_external = true; - t->title = talloc_strdup(t, mp_basename(disp_filename)); + if (sh->title && sh->title[0]) { + t->title = talloc_strdup(t, sh->title); + } else { + t->title = talloc_strdup(t, mp_basename(disp_filename)); + } t->external_filename = talloc_strdup(t, filename); t->no_default = sh->type != filter; t->no_auto_select = t->no_default; |