Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Steven Liu <lingjiujianke@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3] avformat/hls: Fixed incorrect behaviour of default
Date: Tue, 16 Jul 2024 18:59:50 +0800
Message-ID: <CADxeRwnbfXjkyiBb5V+SCLqn6nJjqT-zEbdcjFDaFfnhza7Y1g@mail.gmail.com> (raw)
In-Reply-To: <CADxeRwn-3dQWvVeCp0pz07Vb6PjV0eAgn-jWS2_iTMdhEan3eQ@mail.gmail.com>

Steven Liu <lingjiujianke@gmail.com> 于2024年7月15日周一 21:47写道:
>
> CoderVenkat <codervenkat@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-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2024-07-16 11:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 13:27 [FFmpeg-devel] [PATCH] avformat/hls: Fixed incorrect behaviour of default setting, , added autoselect and forced CoderVenkat
2024-07-07 10:18 ` Steven Liu
2024-07-08 13:43   ` [FFmpeg-devel] [PATCH v2] avformat/hls: Fixed incorrect behaviour of default CoderVenkat
2024-07-14  8:21     ` CoderVenkat
2024-07-14 12:04       ` Steven Liu
2024-07-14 15:16         ` [FFmpeg-devel] [PATCH v3] " CoderVenkat
2024-07-14 16:06           ` CoderVenkat
2024-07-15 13:47             ` Steven Liu
2024-07-16 10:59               ` Steven Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADxeRwnbfXjkyiBb5V+SCLqn6nJjqT-zEbdcjFDaFfnhza7Y1g@mail.gmail.com \
    --to=lingjiujianke@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git