[FFmpeg-devel] [PATCH] swscale: fix deprecation message for JPEG

Werner Robitza werner.robitza at gmail.com
Wed Nov 24 13:57:38 EET 2021


This message frequently confuses end users, making them think that they are
doing something wrong [1].

The fact that the "J" format itself is deprecated should not be bothering
the end users.

Since the format can only be changed when the handle_jpeg() function is
called, this means we can tell the users about the fact that the JPEG
conversion is causing this, and that they should check the range.

[1]: https://superuser.com/q/1273920/48078
[2]: https://superuser.com/q/1663477/48078

Signed-off-by: Werner Robitza <werner.robitza at gmail.com>
---
 libswscale/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index c726922527..78f84d990a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1291,7 +1291,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
     c->dstRange |= handle_jpeg(&c->dstFormat);
 
     if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat)
-        av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n");
+        av_log(c, AV_LOG_WARNING, "pixel format was changed automatically for JPEG, make sure the color range is set correctly\n");
 
     if (!c->contrast && !c->saturation && !c->dstFormatBpp)
         sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], c->srcRange,
-- 
2.33.1



More information about the ffmpeg-devel mailing list