CoderVenkat <coderven...@gmail.com> 于2024年7月14日周日 16:21写道:
Hi Coder Venkat,

>
> Ping.
> Any chance you could take a look? I would like to submit another fix based on 
> this.

@@ -1434,6 +1436,31 @@ static int create_master_playlist(AVFormatContext *s,
         avio_printf(hls->m3u8_out, ",INSTREAM-ID=\"%s\"\n", ccs->instreamid);
     }

+    /* Check only one default is present in a group */
+    for (i = 0; i < hls->nb_varstreams; i++) {
+        vs = &(hls->var_streams[i]);
+        for (j = 0; j < hls->nb_varstreams; j++) {
+            if (i != j) {
+                temp_vs = &(hls->var_streams[j]);
+                if (vs->agroup && temp_vs->agroup &&
+                    !vs->has_video && !temp_vs->has_video) {
+                    if (!av_strcasecmp(vs->agroup, temp_vs->agroup) &&
+                        vs->is_default && temp_vs->is_default) {
+                        av_log(s, AV_LOG_ERROR, "Two streams in an
agroup can not be default\n");
+                        goto fail;
+                    }
+                } else if (vs->sgroup && temp_vs->sgroup &&
+                            !vs->has_video && !temp_vs->has_video) {
+                    if (!av_strcasecmp(vs->sgroup, temp_vs->sgroup) &&
+                        vs->is_default && temp_vs->is_default) {
+                        av_log(s, AV_LOG_ERROR, "Two streams in an
sgroup can not be default\n");
+                        goto fail;
+                    }
+                }
+            }
+        }
+    }
+
     /* For audio only variant streams add #EXT-X-MEDIA tag with attributes*/
     for (i = 0; i < hls->nb_varstreams; i++) {
         vs = &(hls->var_streams[i]);
@@ -1452,7 +1479,7 @@ static int create_master_playlist(AVFormatContext


Can these logic be optimized? for example, audio in one for logic,
subtitle in the other for logic.
> Thanks,
> vckt
>
Thanks
Steven
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to