On Mon, Aug 19, 2024 at 7:31 PM Timo Rothenpieler <t...@rothenpieler.org> wrote: > > On 19.08.2024 16:23, Araz Iusubov wrote: > > From: Evgeny Pavlov <lucenti...@gmail.com> > > > > This commit increase precision of Sleep() function on Windows. > > This fix reduces the sleep time on Windows to improve AMF encoding > > performance on low resolution input videos. > > > > Fix for issue #10622 > > > > We evaluated CreateWaitableTimerExW with > > CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag. In fact, this function has > > the same precision level as the Sleep() function. > > > > Usually changing the time resolution will only affect the current > > process and will not impact other processes, thus it will not cause a > > global effect on the current system. Here is an info from > > documentation on timeBeginPeriod > > https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod > > > > "Prior to Windows 10, version 2004, this function affects a global > > Windows setting. For all processes Windows uses the lowest value (that > > is, highest resolution) requested by any process. Starting with > > Windows 10, version 2004, this function no longer affects global timer > > resolution. For processes which call this function, Windows uses the > > lowest value (that is, highest resolution) requested by any process. > > For processes which have not called this function, Windows does not > > guarantee a higher resolution than the default system resolution." > > Even modifying the current process is not acceptable, since lavc is > frequently embedded in other applications, which might not expect > this/be aversely impacted by it. > > Why does the AMF wrapper need to sleep at all?
Agreed, we can't have things like this in FFmpeg. This might be acceptable in a binary blob but not in an open source project. Kieran _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".