diff options
author | Nicolas George | 2012-07-29 12:33:35 +0200 |
---|---|---|
committer | Nicolas George | 2012-07-31 17:23:31 +0200 |
commit | 1c9878183772d770cc398e5e76c1db8f74a929fe (patch) | |
tree | c349484483bbf0520b670cc1445a061144c77926 /libavcodec | |
parent | 9009fa6de4004b5d9ddb2429784ac234123ec7e5 (diff) |
8svx: use a more direct condition.
esc->table was inited based on codec->id: re-testing codec->id
is code duplication and can lead to inconsistencies.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/8svx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index 6aa52d1e6c..3bece41627 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -112,13 +112,13 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, if (!esc->samples && avpkt) { uint8_t *deinterleaved_samples, *p = NULL; - esc->samples_size = avctx->codec->id == CODEC_ID_8SVX_RAW || avctx->codec->id ==CODEC_ID_PCM_S8_PLANAR? + esc->samples_size = !esc->table ? avpkt->size : avctx->channels + (avpkt->size-avctx->channels) * 2; if (!(esc->samples = av_malloc(esc->samples_size))) return AVERROR(ENOMEM); /* decompress */ - if (avctx->codec->id == CODEC_ID_8SVX_FIB || avctx->codec->id == CODEC_ID_8SVX_EXP) { + if (esc->table) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int n = esc->samples_size; @@ -166,7 +166,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data, *dst++ = *src++ + 128; esc->samples_idx += out_data_size; - return avctx->codec->id == CODEC_ID_8SVX_FIB || avctx->codec->id == CODEC_ID_8SVX_EXP ? + return esc->table ? (avctx->frame_number == 0)*2 + out_data_size / 2 : out_data_size; } |