X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fvmdav.c;h=328abbb3c7d8eca6334cbbc3c8999b7faf3cd112;hb=52476c1beeafbb31e3277e950ec175444ece05af;hp=00b0f59af336012a58d2291c16eda0b49ca55a41;hpb=162d4fc99d07fcd3322aee9bcc99f045463da2b7;p=ffmpeg diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 00b0f59af33..328abbb3c7d 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -162,13 +162,13 @@ static int rle_unpack(const unsigned char *src, unsigned char *dest, if (l & 0x80) { l = (l & 0x7F) * 2; if (pd + l > dest_end) - return (ps - src); + return ps - src; memcpy(pd, ps, l); ps += l; pd += l; } else { if (pd + i > dest_end) - return (ps - src); + return ps - src; for (i = 0; i < l; i++) { *pd++ = ps[0]; *pd++ = ps[1]; @@ -178,7 +178,7 @@ static int rle_unpack(const unsigned char *src, unsigned char *dest, i += l; } while (i < src_len); - return (ps - src); + return ps - src; } static void vmd_decode(VmdVideoContext *s) @@ -422,7 +422,7 @@ typedef struct VmdAudioContext { int predictors[2]; } VmdAudioContext; -static uint16_t vmdaudio_table[128] = { +static const uint16_t vmdaudio_table[128] = { 0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0, @@ -444,8 +444,9 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx) s->avctx = avctx; s->channels = avctx->channels; - s->bits = avctx->bits_per_sample; + s->bits = avctx->bits_per_coded_sample; s->block_align = avctx->block_align; + avctx->sample_fmt = SAMPLE_FMT_S16; av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n", s->channels, s->bits, s->block_align, avctx->sample_rate); @@ -561,7 +562,7 @@ AVCodec vmdvideo_decoder = { vmdvideo_decode_end, vmdvideo_decode_frame, CODEC_CAP_DR1, - .long_name = "Sierra VMD video", + .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"), }; AVCodec vmdaudio_decoder = { @@ -573,5 +574,5 @@ AVCodec vmdaudio_decoder = { NULL, NULL, vmdaudio_decode_frame, - .long_name = "Sierra VMD audio", + .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"), };