]> git.sesse.net Git - ffmpeg/commitdiff
swscale/utils: override forced-zero formats back to full range
authorJan Ekström <jeebjp@gmail.com>
Fri, 9 Oct 2020 22:33:27 +0000 (01:33 +0300)
committerJan Ekström <jeebjp@gmail.com>
Sun, 11 Oct 2020 09:58:13 +0000 (12:58 +0300)
Fixes vf_scale outputting RGB AVFrames with limited range flagged
in case either input or output specifically sets the range.

This is the reverse of the logic utilized for RGB and PAL8 content
in sws_setColorspaceDetails.

libswscale/utils.c

index 832c9f873c9bc7c4c30d8361affabb914693339e..352a8ed116300a01ddf72d244a7a91386c6b47e5 100644 (file)
@@ -1013,8 +1013,8 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
 
     *inv_table  = c->srcColorspaceTable;
     *table      = c->dstColorspaceTable;
-    *srcRange   = c->srcRange;
-    *dstRange   = c->dstRange;
+    *srcRange   = range_override_needed(c->srcFormat) ? 1 : c->srcRange;
+    *dstRange   = range_override_needed(c->dstFormat) ? 1 : c->dstRange;
     *brightness = c->brightness;
     *contrast   = c->contrast;
     *saturation = c->saturation;