1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-05-13 21:26:33 +02:00
FFmpeg/libswscale
Niklas Haas cedf589c09 swscale: fix sws_setColorspaceDetails after sws_init_context
More commonly, this fixes the case of sws_setColorspaceDetails after
sws_getContext, since the latter implies sws_init_context.

The problem here is that sws_init_context sets up the range conversion
and fast path tables based on the values of srcRange/dstRange at init
time. This may result in locking in a "wrong" path (either using
unscaled fast path when range conversion later required, or using
scaled slow path when range conversion becomes no longer required).

There are two way outs:

1. Always initialize range conversion and unscaled converters, even if
   they will be unused, and extend the runtime check.
2. Re-do initialization if the values change after
   sws_setColorspaceDetails.

I opted for approach 1 because it was simpler and easier to reason
about.

Reword the av_log message to make it clear that this special converter
is not necessarily used, depending on whether or not there is range
conversion or YUV matrix conversion going on.
2023-11-09 12:53:35 +01:00
..
2023-05-20 20:07:18 +02:00
2022-01-04 19:39:22 -06:00
2015-09-04 19:00:20 -03:00
2023-09-28 19:37:58 +02:00
2014-08-12 20:52:21 +02:00
2023-09-28 19:37:58 +02:00
2023-10-29 16:19:14 +01:00