diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-17 21:51:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-17 22:00:20 +0100 |
commit | 5bccb2d0965a66c132798c748b64a5025a5636a9 (patch) | |
tree | 0fa47331467a029c7c40f7747a9b9223f4ba56ca /libswscale | |
parent | 34958174687e7815be21a4ef188f5fca930a0c10 (diff) | |
download | ffmpeg-5bccb2d0965a66c132798c748b64a5025a5636a9.tar.gz |
sws: handle jpeg pixel formats in sws_init_context()
Fixes Ticket576
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index b4e230b705..781f728919 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -771,6 +771,15 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) unscaled = (srcW == dstW && srcH == dstH); + handle_jpeg(&srcFormat); + handle_jpeg(&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"); + c->srcFormat= srcFormat; + c->dstFormat= dstFormat; + } + if (!sws_isSupportedInput(srcFormat)) { av_log(c, AV_LOG_ERROR, "%s is not supported as input pixel format\n", av_get_pix_fmt_name(srcFormat)); return AVERROR(EINVAL); |