[FFmpeg-devel] [PATCH 06/16] vmdaudio: correct the silent chunk count in the first block.

Ronald S. Bultje rsbultje
Thu Feb 24 03:06:46 CET 2011


Hi,

On Wed, Feb 23, 2011 at 1:59 PM, Kostya <kostya.shishkov at gmail.com> wrote:
> On Wed, Feb 23, 2011 at 01:11:03PM -0500, Justin Ruggles wrote:
>>
>> This fixes A/V sync with several samples, notably:
>> http://samples.mplayerhq.hu/game-formats/sierra-vmd/swat_*.vmd
>> ---
>> ?libavcodec/vmdav.c | ? ?6 +-----
>> ?1 files changed, 1 insertions(+), 5 deletions(-)
>>
>
>> diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
>> index 025d23a..ed3c5f8 100644
>> --- a/libavcodec/vmdav.c
>> +++ b/libavcodec/vmdav.c
>> @@ -517,11 +517,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
>> ? ? ? ? ?uint32_t flags = AV_RB32(p);
>> ? ? ? ? ?int raw_block_size = s->block_align *
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (av_get_bits_per_sample_fmt(avctx->sample_fmt) / 8);
>> - ? ? ? ?int silent_chunks;
>> - ? ? ? ?if(flags == 0xFFFFFFFF)
>> - ? ? ? ? ? ?silent_chunks = 32;
>> - ? ? ? ?else
>> - ? ? ? ? ? ?silent_chunks = av_log2(flags + 1);
>> + ? ? ? ?int silent_chunks = av_popcount(flags);
>> ? ? ? ? ?if(*data_size < (s->block_align*silent_chunks + buf_size - 20) * 2)
>> ? ? ? ? ? ? ?return -1;
>> ? ? ? ? ?*data_size = 0;
>
> ok

Queued.

Ronald



More information about the ffmpeg-devel mailing list