diff mbox series

[FFmpeg-devel,2/2] swscale/utils: override forced-zero formats back to full range

Message ID 20201010002029.6837-2-jeebjp@gmail.com
State Accepted
Commit 7ea4bcff7b038774b404bad2b9c7112a7855a088
Headers show
Series [FFmpeg-devel,1/2] swscale/utils: split range override check into its own function
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make warning Make failed

Commit Message

Jan Ekström Oct. 10, 2020, 12:20 a.m. UTC
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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 832c9f873c..352a8ed116 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -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;