diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-01-11 12:11:36 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-01-11 12:15:03 +0100 |
commit | a5334d408148f20e0680f65daa3aff837c5f5db5 (patch) | |
tree | 90ef39b498b9490100b006e0636ad078b4e5a410 /libavcodec/r210dec.c | |
parent | aa6545e1f30e6f0aa7ad7498f524190b978b4e02 (diff) | |
download | ffmpeg-a5334d408148f20e0680f65daa3aff837c5f5db5.tar.gz |
Handle r10k endianess atom DpxE.
Fixes playback and remuxing of r10k_full-range_big-endian.mov.
Reported, analyzed and tested by Olaf Matthes, olaf matthes gmx de
Diffstat (limited to 'libavcodec/r210dec.c')
-rw-r--r-- | libavcodec/r210dec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index a2e1a070e1..fc9e7e5ce5 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -47,6 +47,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, avctx->codec_id == AV_CODEC_ID_R10K ? 1 : 64); uint8_t *dst_line; int r10 = (avctx->codec_tag & 0xFFFFFF) == MKTAG('r', '1', '0', 0); + int le = avctx->codec_tag == MKTAG('R', '1', '0', 'k') && + avctx->extradata_size >= 12 && !memcmp(&avctx->extradata[4], "DpxE", 4) && + !avctx->extradata[11]; if (avpkt->size < 4 * aligned_width * avctx->height) { av_log(avctx, AV_LOG_ERROR, "packet too small\n"); @@ -65,7 +68,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, for (w = 0; w < avctx->width; w++) { uint32_t pixel; uint16_t r, g, b; - if (avctx->codec_id == AV_CODEC_ID_AVRP || r10) { + if (avctx->codec_id == AV_CODEC_ID_AVRP || r10 || le) { pixel = av_le2ne32(*src++); } else { pixel = av_be2ne32(*src++); |