[FFmpeg-devel] [PATCH] seek print NOPTS

Reimar Döffinger Reimar.Doeffinger
Tue Oct 20 16:32:20 CEST 2009


On Tue, Oct 20, 2009 at 04:16:39PM +0200, Michael Niedermayer wrote:
> On Tue, Oct 20, 2009 at 02:59:16PM +0200, Reimar D?ffinger wrote:
> > +static void ts_str(char buffer[60], int64_t ts, AVRational base)
> > +{
> > +    double tsval;
> > +    if (ts == AV_NOPTS_VALUE) {
> > +        strcpy(buffer, " NOPTS   ");
> > +        return;
> > +    }
> > +    tsval = ts * av_q2d(base);
> > +    snprintf(buffer, 60, "%9f", tsval);
> > +}
> 
> if (ts == AV_NOPTS_VALUE)
>     tsval= NAN;
> ...
> av_log("...%123f...", ... tsval
> 
> does not work on all supported archs?

I have no idea, however IMO avoiding those 3 lines of code
is not worth it, since the NaN
1) is less clear than NOPTS
2) with your suggestion, it would be right-aligned, looking uglier.
3) it would need a math.h include and a conditional #define for NAN like in libavutil/matheatics.h

Should I investigate the NAN approach or are you fine with the current one?



More information about the ffmpeg-devel mailing list