mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 15:39:10 +00:00
fix pipewire camera interval fraction inversion
SDL expects an interval fraction to be provided by the backend, but pipewire provides a framerate fraction, we we just switch them.
This commit is contained in:
parent
fbe7e2e6d3
commit
0ee874f02d
1 changed files with 2 additions and 1 deletions
|
@ -621,8 +621,9 @@ static void collect_rates(CameraFormatAddData *data, struct param *p, const Uint
|
|||
SPA_FALLTHROUGH;
|
||||
case SPA_CHOICE_Enum:
|
||||
for (i = 0; i < n_vals; i++) {
|
||||
// denom and num are switched, because sdl expects an interval, while pw provides a rate
|
||||
if (SDL_AddCameraFormat(data, sdlfmt, size->width, size->height,
|
||||
rates[i].num, rates[i].denom) == -1) {
|
||||
rates[i].denom, rates[i].num) == -1) {
|
||||
return; // Probably out of memory; we'll go with what we have, if anything.
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue