[FFmpeg-devel] [PATCH] ffprobe: add -show_data_hash option.

Nicolas George george at nsup.org
Sun May 4 16:45:08 CEST 2014


Le quintidi 15 floréal, an CCXXII, Nicolas George a écrit :
> This time with a list of ciphers in the error message.

> +                av_log(NULL, AV_LOG_ERROR,
> +                       "Unknown hash algorithm '%s'\nKnown algorithms:",
> +                       show_data_hash);
> +                for (i = 0; (n = av_hash_names(i)); i++)
> +                    av_log(NULL, AV_LOG_ERROR, " %s", n);
> +                av_log(NULL, AV_LOG_ERROR, "\n");

For this kind of situation, I believe we should make a habit of having
always two version of the function:

    int av_foo_get(FooContext *rfoo, const char *name);

    int av_foo_parse(FooContext *rfoo, const char *name, void *log);

The first one just returns an error code, the second one logs a clear error
message (possibly with the detailed explanation of the error, or in this
case the list of accepted strings).

If we can stick to a stable naming convention (maybe _parse is already used
in too much places to serve), that would be a great help.

Any thoughts?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140504/ac747d65/attachment.asc>


More information about the ffmpeg-devel mailing list