Steven Liu <lingjiujia...@gmail.com> 于2024年7月15日周一 21:47写道:
>
> CoderVenkat <coderven...@gmail.com> 于2024年7月15日周一 00:07写道:
> >
> > Apologies
> > Correct file attached in this 
> > mail._______________________________________________
> I need more time look at the deep for and if logic.
Hi CoderVenkat,

+    /* Check only one default audio stream is present in a group */
+    for (i = 0; i < hls->nb_varstreams; i++) {
+        vs = &(hls->var_streams[i]);
+        if (vs->agroup && !vs->has_video) {
+            for (j = 0; j < hls->nb_varstreams; j++) {
+                if (i != j) {
+                    temp_vs = &(hls->var_streams[j]);
+                    if (temp_vs->agroup && !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;
+                        }
+                    }
+                }
+            }
+        }
+    }

Can this logic modify as bellow?

int has_default = 0;
for (i = 0; i < hls->nb_varstreams; i++) {
    vs = &(hls->var_streams[i]);
    if (vs->is_default == 1)
        has_default++;
    if (vs->agroup && !vs->has_video && has_default > 1) {
        av_log(s, AV_LOG_ERROR, "Two streams in an agroup can not be
default\n");
        has_default = 0;
        goto fail;
   }
}
has_default = 0;

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