[FFmpeg-devel] [PATCH] lavf/utils: extend has_codec_parameters() to make it show what info is missing

Michael Niedermayer michaelni at gmx.at
Mon Jul 16 05:04:55 CEST 2012


On Mon, Jul 16, 2012 at 12:30:58AM +0200, Stefano Sabatini wrote:
> Improve feedback.
> ---
>  libavformat/utils.c |   47 ++++++++++++++++++++++++++++++-----------------
>  1 files changed, 30 insertions(+), 17 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 39527a6..74b6746 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2265,30 +2265,40 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
>      }
>  }
>  
> -static int has_codec_parameters(AVStream *st)
> +static int has_codec_parameters(AVStream *st, char *error, size_t error_size)
>  {
>      AVCodecContext *avctx = st->codec;
> -    int val;
> +
> +#define FAIL(errmsg) do {                               \
> +        if (error)                                      \
> +            av_strlcpy(error, errmsg, error_size);      \
> +        return 0;                                       \
> +    } while (0)
> +

passing a flag into has_codec_parameters() and printing the message
in there when its != 0 seems cleaner
not sure if theres a even cleaner way

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

The real ebay dictionary, page 1
"Used only once"    - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120716/1e318e84/attachment.asc>


More information about the ffmpeg-devel mailing list