[FFmpeg-devel] [RFC] lavu PTS printing utils

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jan 15 16:17:53 CET 2012


On Sun, Jan 15, 2012 at 04:07:27PM +0100, Stefano Sabatini wrote:
> Hi,
> 
> I'm thinking to implement some convenience utils:
> 
> static inline size_t av_get_ts_string(char *buf, size_t buf_size, int64_t ts)
> {
>     return ts == (AV_NOPTS_VALUE) ? snprintf(buf, buf_size, "NOPTS") :
>                                     snprintf(buf, buf_size, "%"PRId64"", ts);

At least leave out the pointless () and "".

> since it seems I need to use them again and again (debugging timestamp
> issues in various components).

Quite a few places want them aligned though, and those won't work
there.

> Do you think this would be a good idea? If yes, where should I put them
> (libavutil/printutils.h may be an option)?

I'd say most likely only if it is flexible enough to replace (almost)
all of the code doing this and it still is an improvement.


More information about the ffmpeg-devel mailing list