It is not uncommon for swapchain image acquire to fail multiple times in
a row e.g. when the user is continuously resizing the windown with the
mouse cursor. There is really no need to raise an exception and crash
the whole process.
When vkAcquireNextImage() returns VK_SUBOPTIMAL_KHR it means that a valid
usable image was still acquired and that means that the
acquire_samaphore is pending and signalled as normal.
This means we cannot just recreate the swapchain and reuse it to acquire
an image from the new swapchain as VulkanDisplay::display_queued_image()
was doing, because the spec states that the semaphore must be unsignaled
and not pending.
The fix here is to render and display the suboptimal image as normal and
set a flag to immediately return swapchain_image_out_of_date to trigger
a swapchain recreation on the next frame.
Added additional number validitiy check (to newly created parse_number
function). Mainly to cover inputs like '1something' where it should
not be parsed correctly as being 1.
Do not use positional references to printf format string, which is a
POSIX extension and not supported by Windows C library.
+ write the optarg string (in case that is only partionally parsed -
atoi stopped at first non-number)
refers to GH-437
Sort sampling rates for poraudio playback that are tested if the device
doesn't support natively the received sample rate.
Use lowest higher or equal sampling rate if possible, if not, use the
highest usable sampling rate.
Also remove note in qsort_s.h (no longer valid - can be included where
approopriate, not only before first inclusion of stdlib.h).
This complements the previous commit - add the device default rate to
list of rates, that are tested if work (obviously this one should work
by definition so that now testing the remaining sample rates shouldn't
take place).
For VP9, libsvt_vp9 is preferrd (if built-in, which is in Linux builds),
but it compiles with AVX2 by default, so prefer libvpx if CPU doesn't
support that.
PortAudio/ASIO drivers seem refuse initialization if
CoInitilizeEx initialized as COINIT_MULTITHREADED but they do for
COINIT_APARTMENTTHREADED.
Windows devices that could be affected by this change tested and seem
to work, namely:
- DeckLink
- DirectShow
- WASAPI
refer to GH-430
The commit b785c3d8 from 2024-08-05 changed the default unconditionally
to PCM, but this has been true just for UltraGrid RTP, not RTSP or SDP
that used MP3, so this change reverts it back.
If the input is already compressed, try to pass it further. Initialize
the compression just if receiving uncompressed data.
This is implemented in the same way as it already is in vrxtx/sdp.
refers to GH-433
video_display putf implementation may free the frame so that the pointer
is no longer valid upon the exit from the callback (or anytime later).
This is the case for eg. vdisp/decklink.
Fixes `uv -t testcard -c lavc -d dummy:discard` (wrong color in output
line):
```
[dummy] 126 frames in 5.03501 seconds = 25.0248 FPS
```
even though FPS is +/- the nominal 25. Depending on circumstances it
could have also easily crashed (access after free).
The mutibyte to wide character conversion was (perhaps since the
beginning) wrong - mbtowc converts just one character - it should have
beem mbstowcs but using rather mbsrttowcs (thread-safe).
There are some calls using just the codec_ctx
parameter, which fail (with the compat with
legacy FFmpeg).
eg. `uv -A Opus -s testcard` (using the old FFmpeg)
1. static_assert could not have been strictly speaking used (splash_width
is not constexpr), although it worked most of the time (except macports
clang-mp-14)
2. the assertion was actually inverted (but the equality is included
and is the case for both cases so both work)