From 8f35b3873f5d99120ac8edec8f36d393f8a81b11 Mon Sep 17 00:00:00 2001 From: thewisenerd Date: Sun, 21 Oct 2018 20:16:54 +0530 Subject: player: use track title if exists instead of filename --- player/loadfile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'player/loadfile.c') 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; -- cgit v1.2.3