avformat/dashenc: only write video streams into HLS master playlist
authorJian Yang <yangjian0911@gmail.com>
Fri, 14 Sep 2018 07:08:17 +0000 (15:08 +0800)
committerKarthick Jeyapal <kjeyapal@akamai.com>
Thu, 11 Oct 2018 07:16:31 +0000 (12:46 +0530)
Tool mediastreamvalidator reports error "Variant media_[N].m3u8 is
missing audio group" for audio streams in HLS master playlist. As audio
streams are already listed in audio group, skip them as variant media
streams in master playlist.

libavformat/dashenc.c

index b0bb35426bbd9643520ca55b04acdf2843cf6dca..26a4dcea60f1fbc7f795bd6a67d6f1a250a0e918 100644 (file)
@@ -911,8 +911,10 @@ static int write_manifest(AVFormatContext *s, int final)
             OutputStream *os = &c->streams[i];
             char *agroup = NULL;
             int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
+            if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
+                continue;
             av_strlcpy(codec_str, os->codec_str, sizeof(codec_str));
-            if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && max_audio_bitrate) {
+            if (max_audio_bitrate) {
                 agroup = (char *)audio_group;
                 stream_bitrate += max_audio_bitrate;
                 av_strlcat(codec_str, ",", sizeof(codec_str));