[FFmpeg-devel] [PATCH] seek print NOPTS
Reimar Döffinger
Reimar.Doeffinger
Tue Oct 20 17:38:27 CEST 2009
On Tue, Oct 20, 2009 at 01:21:28PM -0200, Ramiro Polla wrote:
> On Tue, Oct 20, 2009 at 12:32 PM, Reimar D?ffinger
> <Reimar.Doeffinger at gmx.de> wrote:
> > 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?
>
> This has been discussed before [0].
>
> Quoting myself from that thread:
> "MSVCRT prints "-1.INF00" or something like that, which is much different
> than the POSIX "nan". Anyways POSIX allows other stuff to print out
> instead of "nan", so it wouldn't even be compatible in all
> POSIX-compliant systems. I'll try to think of some other way."
I thought so, so this is settled, applied.
More information about the ffmpeg-devel
mailing list