aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2009-02-22 00:56:55 +0000
committerPeter Ross <pross@xvid.org>2009-02-22 00:56:55 +0000
commit001821904e316b68c42d1671dcf963e5f7c648f7 (patch)
tree42385931606ea3994cb87b7dfe4912f59dd5ecc6 /libavcodec/pnm.c
parent88c21a6f149e27ff860226043d6c31998152c883 (diff)
downloadffmpeg-001821904e316b68c42d1671dcf963e5f7c648f7.tar.gz
Support 48-bit RGB PPM image.
Originally committed as revision 17511 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index ba169d1473..4843d14653 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -138,8 +138,11 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s){
avctx->pix_fmt = PIX_FMT_GRAY16BE;
if (s->maxval != 65535)
avctx->pix_fmt = PIX_FMT_GRAY16;
+ } if (avctx->pix_fmt == PIX_FMT_RGB24) {
+ if (s->maxval > 255)
+ avctx->pix_fmt = PIX_FMT_RGB48BE;
} else {
- av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");
+ av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
avctx->pix_fmt = PIX_FMT_NONE;
return -1;
}