aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-09-26 11:11:06 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-09-26 11:11:06 +0200
commitd0aec0aae872d00402e6d81d0884ddbcb657c087 (patch)
treee897f26e8b497c3639b37cea4d43d978c0be76fe /libavcodec
parent2b61cc44433e47c98ec3336bea14f69fdfc9c616 (diff)
parent588a5619da0d041e55b365f63d0fa9c72bdbd4d3 (diff)
downloadffmpeg-d0aec0aae872d00402e6d81d0884ddbcb657c087.tar.gz
Merge commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3'
* commit '588a5619da0d041e55b365f63d0fa9c72bdbd4d3': dxv: Parse ancillary encoder information Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dxv.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index e375734ebd..2ecf61927b 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -322,7 +322,8 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
GetByteContext *gbc = &ctx->gbc;
int (*decompress_tex)(AVCodecContext *avctx);
uint32_t tag;
- int channels, size = 0, old_type = 0;
+ int version_major, version_minor = 0;
+ int size = 0, old_type = 0;
int ret;
bytestream2_init(gbc, avpkt->data, avpkt->size);
@@ -351,7 +352,8 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
/* Old version does not have a real header, just size and type. */
size = tag & 0x00FFFFFF;
old_type = tag >> 24;
- channels = old_type & 0x0F;
+ version_major = (old_type & 0x0F) - 1;
+
if (old_type & 0x40) {
av_log(avctx, AV_LOG_DEBUG, "LZF compression and DXT5 texture ");
ctx->tex_funct = ctx->texdsp.dxt5_block;
@@ -371,11 +373,13 @@ static int dxv_decode(AVCodecContext *avctx, void *data,
/* New header is 12 bytes long. */
if (!old_type) {
- channels = bytestream2_get_byte(gbc);
- bytestream2_skip(gbc, 3); // unknown
+ version_major = bytestream2_get_byte(gbc) - 1;
+ version_minor = bytestream2_get_byte(gbc);
+
+ bytestream2_skip(gbc, 2); // unknown
size = bytestream2_get_le32(gbc);
}
- av_log(avctx, AV_LOG_DEBUG, "(%d channels)\n", channels);
+ av_log(avctx, AV_LOG_DEBUG, "(version %d.%d)\n", version_major, version_minor);
if (size != bytestream2_get_bytes_left(gbc)) {
av_log(avctx, AV_LOG_ERROR, "Incomplete or invalid file (%u > %u)\n.",