[FFmpeg-devel] [PATCH v3] avformat/hls: Fixed incorrect behaviour of default
Steven Liu
lingjiujianke at gmail.com
Tue Jul 16 13:59:50 EEST 2024
Steven Liu <lingjiujianke at gmail.com> 于2024年7月15日周一 21:47写道:
>
> CoderVenkat <codervenkat at 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
More information about the ffmpeg-devel
mailing list