Le quartidi 4 brumaire, an CCXXIV, Mark Harris a écrit : > > + if (sleep > s->limit || sleep < -s->limit) { > > + av_log(ctx, AV_LOG_WARNING, > > + "time discontinuity detected: %"PRIi64" us, > > resetting\n", > > + sleep); > Won't this also be shown when there is no discontinuity but it isn't > able to keep up with realtime (e.g. due to a very high frame rate)? > The message is misleading in that situation.
This is true, but I consider it an acceptable approximation for now. I am sure any user would guess what it means if the CPU is permanently at 100% and this warning is printed repeatedly. An heuristic could be added to detect when processing is slower than realtime and print a warning accordingly, but tuning it would require more time than I want to spend on this right now. > The argument to av_usleep() is an unsigned int. Should the maximum > limit be UINT_MAX rather than INT64_MAX? Alternatively it could call > av_usleep() in a loop if the value is too large for one call. Good catch, although it would probably not matter in practice: that would involve a >1 hour gap between frames, the user actually wanting to sleep for that time and having set the limit accordingly. But all the same, I added this locally: + for (; sleep > 600000000; sleep -= 600000000) + av_usleep(600000000); (I used 600000000 instead of UINT_MAX because I do not trust values too near the limit value for that kind of system call; a spurious wakeup every 10 minutes is acceptable. Also, it will probably be easier to guess what it means when reading strace output.) Thanks for the review. Regards, -- Nicolas George
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel