diff options
author | Karthick Jeyapal <kjeyapal@akamai.com> | 2017-12-29 13:47:12 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-12-29 13:47:12 +0800 |
commit | 8fd2bdd07207cc7e055915f470302596bcfebeea (patch) | |
tree | ffb46e59a12bd92d132e0acf12fa15b2b8b76c9e /libavformat/hlsplaylist.c | |
parent | 9e25fe420410c0e1b77cc68f53cc0cd2f79ba30a (diff) |
avformat/hlsplaylist: Audio rendition's name and defaultness made configurable
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsplaylist.c')
-rw-r--r-- | libavformat/hlsplaylist.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index a065eda59d..098dc89170 100644 --- a/libavformat/hlsplaylist.c +++ b/libavformat/hlsplaylist.c @@ -36,12 +36,13 @@ void ff_hls_write_playlist_version(AVIOContext *out, int version) { } void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup, - char *filename) { + char *filename, int name_id, int is_default) { if (!out || !agroup || !filename) return; avio_printf(out, "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"group_%s\"", agroup); - avio_printf(out, ",NAME=\"audio_0\",DEFAULT=YES,URI=\"%s\"\n", filename); + avio_printf(out, ",NAME=\"audio_%d\",DEFAULT=%s,URI=\"%s\"\n", name_id, + is_default ? "YES" : "NO", filename); } void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, |