diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 04:25:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-12-06 04:25:56 +0100 |
commit | b22c16daafdf314a102b7f9d3810246cb45c2363 (patch) | |
tree | a740d6ed3be1f0a56ce581d8471863df2f5ebc29 /libavcodec | |
parent | fb06b8ba9371495d051d2fd815a21fb1c1392b73 (diff) | |
parent | a1ba1f20b350cb89e645f17bdb237d027170db33 (diff) | |
download | ffmpeg-b22c16daafdf314a102b7f9d3810246cb45c2363.tar.gz |
Merge commit 'a1ba1f20b350cb89e645f17bdb237d027170db33'
* commit 'a1ba1f20b350cb89e645f17bdb237d027170db33':
mjpegenc: cosmetics, reformat jpeg_put_comments()
Conflicts:
libavcodec/mjpegenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mjpegenc.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 1129118856..7cfbe049b8 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -164,18 +164,17 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) int size; uint8_t *ptr; - if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) - { - /* JFIF header */ - put_marker(p, APP0); - put_bits(p, 16, 16); - avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */ - put_bits(p, 16, 0x0102); /* v 1.02 */ - put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ - put_bits(p, 16, avctx->sample_aspect_ratio.num); - put_bits(p, 16, avctx->sample_aspect_ratio.den); - put_bits(p, 8, 0); /* thumbnail width */ - put_bits(p, 8, 0); /* thumbnail height */ + if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) { + /* JFIF header */ + put_marker(p, APP0); + put_bits(p, 16, 16); + avpriv_put_string(p, "JFIF", 1); /* this puts the trailing zero-byte too */ + put_bits(p, 16, 0x0102); /* v 1.02 */ + put_bits(p, 8, 0); /* units type: 0 - aspect ratio */ + put_bits(p, 16, avctx->sample_aspect_ratio.num); + put_bits(p, 16, avctx->sample_aspect_ratio.den); + put_bits(p, 8, 0); /* thumbnail width */ + put_bits(p, 8, 0); /* thumbnail height */ } /* comment */ @@ -189,9 +188,9 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p) AV_WB16(ptr, size); } - if( avctx->pix_fmt == AV_PIX_FMT_YUV420P - ||avctx->pix_fmt == AV_PIX_FMT_YUV422P - ||avctx->pix_fmt == AV_PIX_FMT_YUV444P){ + if (avctx->pix_fmt == AV_PIX_FMT_YUV420P || + avctx->pix_fmt == AV_PIX_FMT_YUV422P || + avctx->pix_fmt == AV_PIX_FMT_YUV444P) { put_marker(p, COM); flush_put_bits(p); ptr = put_bits_ptr(p); |