[FFmpeg-devel] [PATCH 2/4] avformat/utils: be more strict about stream specifiers

Michael Niedermayer michael at niedermayer.cc
Mon Feb 18 18:01:46 EET 2019


On Sun, Feb 17, 2019 at 08:55:38PM +0100, Marton Balint wrote:
> This reworks the code to be more strict about accepting stream specifiers. From
> now on we strictly enforce the syntax in the documentation up until the
> decisive part of the stream specifier. Therefore matching stream specifiers
> always need to be correct, non matching specifiers only need to be correct
> until the decisive part.
> 
> Also recursion is changed to a simple loop.
> 
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  libavformat/utils.c | 81 +++++++++++++++++++++++++++++++++--------------------
>  1 file changed, 50 insertions(+), 31 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index d113a16c80..39290a647d 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -5100,18 +5100,19 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f
>  /**
>   * Matches a stream specifier (but ignores requested index).
>   *
> - * @param index set if a specific index is requested from the matching streams
> + * @param indexptr set to point to the requested stream index if there is one
>   *
>   * @return <0 on error
>   *         0  if st is NOT a matching stream
>   *         >0 if st is a matching stream
>   */
>  static int match_stream_specifier(AVFormatContext *s, AVStream *st,
> -                                  const char *spec, int *index)
> +                                  const char *spec, const char **indexptr)

this produces a warning:

libavformat/utils.c: In function ‘avformat_match_stream_specifier’:
libavformat/utils.c:5267:5: warning: passing argument 4 of ‘match_stream_specifier’ from incompatible pointer type [enabled by default]

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190218/6453e64e/attachment.sig>


More information about the ffmpeg-devel mailing list