On Fri, May 27, 2011 at 08:07:04PM +0100, Måns Rullgård wrote: > Jindřich Makovička <[email protected]> writes: > > > From dd438f5fc92c5b8eb14830b1a81aa9f55d4d11f3 Mon Sep 17 00:00:00 2001 > > From: Jindrich Makovicka <[email protected]> > > Date: Fri, 27 May 2011 20:59:20 +0200 > > Subject: [PATCH] replace usleep() with nanosleep() > > > > According to usleep() manpage: > > > > POSIX.1-2001 declares this function obsolete; use nanosleep(2) instead. > > POSIX.1-2008 removes the specification of usleep(). > > > > --- a/ffmpeg.c > > +++ b/ffmpeg.c > > @@ -1640,8 +1640,12 @@ static int output_packet(AVInputStream *ist, int > > ist_index, > > if (rate_emu) { > > int64_t pts = av_rescale(ist->pts, 1000000, AV_TIME_BASE); > > int64_t now = av_gettime() - ist->start; > > - if (pts > now) > > - usleep(pts - now); > > + if (pts > now) { > > + struct timespec ts; > > + ts.tv_sec = (pts - now) / AV_TIME_BASE; > > + ts.tv_nsec = ((pts - now) % AV_TIME_BASE) * 1000; > > + nanosleep(&ts, NULL); > > + } > > } > > Maybe it's worthwhile putting this in an av_usleep() or similar function.
... ping ... Is this a blocker or shall we push the usleep removal anyway? Diego _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
