[FFmpeg-devel] [PATCH] seek print NOPTS
Michael Niedermayer
michaelni
Tue Oct 20 17:38:23 CEST 2009
On Tue, Oct 20, 2009 at 04:32:20PM +0200, Reimar D?ffinger 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
IMHO "not specified", "nan" or similar are clearer than NOPTS
which isnt a word nor common abbrevation
> 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
one could use 0.0/0.0
>
> Should I investigate the NAN approach or are you fine with the current one?
commit whichever variant you prefer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091020/3191169a/attachment.pgp>
More information about the ffmpeg-devel
mailing list