• Niklas Haas's avatar
    swscale: fix sws_setColorspaceDetails after sws_init_context · cedf589c
    Niklas Haas authored
    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.
    cedf589c
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...