diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-26 15:52:01 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-07-02 08:33:52 -0700 |
commit | 8f440223f6cb2b557ea6e34ca4079fbe415ecb9d (patch) | |
tree | d1037cef0811f9f3aadf582bd83878d376a0c827 /libswscale/utils.c | |
parent | ccfa626db863b6019fd4c316d19d8f7018543bed (diff) | |
download | ffmpeg-8f440223f6cb2b557ea6e34ca4079fbe415ecb9d.tar.gz |
swscale: disable full_chroma_int when converting to non-24/32bpp RGB.
This functionality is only implemented for RGB24/32 and causes crashes
otherwise.
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index eea32a130a..9f0bb7a8b9 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -845,6 +845,19 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat); // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation + if (flags & SWS_FULL_CHR_H_INT && + dstFormat != PIX_FMT_RGBA && + dstFormat != PIX_FMT_ARGB && + dstFormat != PIX_FMT_BGRA && + dstFormat != PIX_FMT_ABGR && + dstFormat != PIX_FMT_RGB24 && + dstFormat != PIX_FMT_BGR24) { + av_log(c, AV_LOG_ERROR, + "full chroma interpolation for destination format '%s' not yet implemented\n", + sws_format_name(dstFormat)); + flags &= ~SWS_FULL_CHR_H_INT; + c->flags = flags; + } if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1; // drop some chroma lines if the user wants it |