Andrey Utkin <[email protected]> writes:

> It is treated not as **AVDictionary, but as an array of such.
> Show it in declaration.
> ---
>  libavformat/avformat.h |    2 +-
>  libavformat/utils.c    |   10 +++++-----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index fff911a..23fb759 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1433,7 +1433,7 @@ int av_find_stream_info(AVFormatContext *ic);
>   * @todo Let the user decide somehow what information is needed so that
>   *       we do not waste time getting stuff the user does not need.
>   */
> -int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
> +int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options[]);
>
>  /**
>   * Find the "best" stream in the file.
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 373f068..8bc983e 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2271,7 +2271,7 @@ int av_find_stream_info(AVFormatContext *ic)
>  }
>  #endif
>
> -int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
> +int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options[])
>  {

Did you compile this?  Did you notice all the warnings it added?
Did you run this?  Did you notice the crashes it causes?

The change makes no sense.  Perhaps what your sense of purity was really
looking for was AVDictionary *options[], which is of course equivalent
with the current declaration.

>      int i, count, ret, read_size, j;
>      AVStream *st;
> @@ -2303,12 +2303,12 @@ int avformat_find_stream_info(AVFormatContext
> *ic, AVDictionary **options)
>          /* Ensure that subtitle_header is properly set. */
>          if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
>              && codec && !st->codec->codec)
> -            avcodec_open2(st->codec, codec, options ? &options[i] : NULL);
> +            avcodec_open2(st->codec, codec, options ? options[i] : NULL);

This has to be wrong.  Regardless of the declaration, you are adding a
pointer dereference which wasn't there before.  Given that the code
currently works, it cannot work after the change.

Next time, please *test* your patches before sending them.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to