Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v2] lavf/dash: Forward strict flag to component demuxers
Date: Wed, 22 May 2024 11:12:12 +0200
Message-ID: <GV1P250MB07379949BF4719C18E6E12C68FEB2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20240522090513.55806-1-post@frankplowman.com>

Frank Plowman:
> Before the patch, opening a DASH file containing streams which require
> experimental decoders was problematic.  No matter where the -strict -2
> was put on the command line, the option was not passed to the demuxer
> for that component.  This resulted in an error, prompting the user to
> add the -strict -2 flag, which is already present.  Decoding appeared to
> continue correctly however.
> 
> Patch removes the error message by creating an options object for the
> demuxer created for the component, which inherits from the parent
> demuxer.
> 
> Signed-off-by: Frank Plowman <post@frankplowman.com>
> ---
> Changes since v1: Use nb_streams stream_info_opts, not just one.
> 
>  libavformat/dashdec.c | 19 +++++++++++++++++--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 555e21bf69..9c5ef5801a 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -1911,13 +1911,28 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation
>      if (ret < 0)
>          goto fail;
>      if (pls->n_fragments) {
> +        AVDictionary **stream_info_opts;
> +
> +        stream_info_opts = av_calloc(pls->ctx->nb_streams, sizeof(*stream_info_opts));
> +        if (!stream_info_opts)
> +            goto fail;

Presumably you should set ret here.

> +
>  #if FF_API_R_FRAME_RATE
>          if (pls->framerate.den) {
> -            for (i = 0; i < pls->ctx->nb_streams; i++)
> +            for (i = 0; i < pls->ctx->nb_streams; i++) {
>                  pls->ctx->streams[i]->r_frame_rate = pls->framerate;
> +                av_dict_set_int(&stream_info_opts[i], "strict", s->strict_std_compliance, 0);

You are setting this in a loop intended to be removed; and one that is
furthermore only executed under certain conditions. This is surely not
what you intended.

> +            }
> +
>          }
>  #endif
> -        ret = avformat_find_stream_info(pls->ctx, NULL);
> +
> +        ret = avformat_find_stream_info(pls->ctx, stream_info_opts);
> +
> +        for (i = 0; i < pls->ctx->nb_streams; i++)

We prefer loop-based iterators nowadays.

> +            av_dict_free(&stream_info_opts[i]);
> +        av_dict_free(stream_info_opts);

This is the wrong deallocator; stream_info_opts will leak.

> +
>          if (ret < 0)
>              goto fail;
>      }

Apart from that my comment about using
AVFormatContext.stridt_std_compliance still applies.

- Andreas

_______________________________________________
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-05-22  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-22  9:02 Frank Plowman
2024-05-22  9:12 ` Andreas Rheinhardt [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=GV1P250MB07379949BF4719C18E6E12C68FEB2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.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