player: use track title if exists instead of filename

This commit is contained in:
thewisenerd 2018-10-21 20:16:54 +05:30 committed by wm4
parent 2a29950020
commit 8f35b3873f
1 changed files with 5 additions and 1 deletions

View File

@ -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;