player: show HLS bitrate as fallback for track titles

HLS streams as demuxed by libavformat have no track title metadata. So
show the HLS bitrate if no title is set. Could be useless or annoying,
so it's a bit controversial, I guess.
This commit is contained in:
wm4
2014-09-01 23:50:25 +02:00
parent 5f14543668
commit 291d986810

View File

@@ -599,6 +599,8 @@ static void handle_stream(demuxer_t *demuxer, int i)
if (lang && lang->value)
sh->lang = talloc_strdup(sh, lang->value);
sh->hls_bitrate = dict_get_decimal(st->metadata, "variant_bitrate", 0);
if (!sh->title && sh->hls_bitrate > 0)
sh->title = talloc_asprintf(sh, "bitrate %d", sh->hls_bitrate);
}
select_tracks(demuxer, i);