summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorKarthick Jeyapal <kjeyapal@akamai.com>2017-12-29 13:47:12 +0800
committerSteven Liu <lq@chinaffmpeg.org>2017-12-29 13:47:12 +0800
commit8fd2bdd07207cc7e055915f470302596bcfebeea (patch)
treeffb46e59a12bd92d132e0acf12fa15b2b8b76c9e /libavformat
parent9e25fe420410c0e1b77cc68f53cc0cd2f79ba30a (diff)
downloadffmpeg-streaming-8fd2bdd07207cc7e055915f470302596bcfebeea.zip
ffmpeg-streaming-8fd2bdd07207cc7e055915f470302596bcfebeea.tar.gz
avformat/hlsplaylist: Audio rendition's name and defaultness made configurable
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c2
-rw-r--r--libavformat/hlsplaylist.c5
-rw-r--r--libavformat/hlsplaylist.h3
3 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index fe531fb..5cff3b4 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1169,7 +1169,7 @@ static int create_master_playlist(AVFormatContext *s,
goto fail;
}
- ff_hls_write_audio_rendition(hls->m3u8_out, vs->agroup, m3u8_rel_name);
+ ff_hls_write_audio_rendition(hls->m3u8_out, vs->agroup, m3u8_rel_name, 0, 1);
av_freep(&m3u8_rel_name);
}
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c
index a065eda..098dc89 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,
diff --git a/libavformat/hlsplaylist.h b/libavformat/hlsplaylist.h
index 518cfc2..9969315 100644
--- a/libavformat/hlsplaylist.h
+++ b/libavformat/hlsplaylist.h
@@ -37,7 +37,8 @@ typedef enum {
} PlaylistType;
void ff_hls_write_playlist_version(AVIOContext *out, int version);
-void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup, char *filename);
+void ff_hls_write_audio_rendition(AVIOContext *out, char *agroup,
+ char *filename, int name_id, int is_default);
void ff_hls_write_stream_info(AVStream *st, AVIOContext *out,
int bandwidth, char *filename, char *agroup);
void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache,
OpenPOWER on IntegriCloud