[FFmpeg-devel] [PATCH] MOV: support stz2 "Compact Sample Size Box"

Baptiste Coudurier baptiste.coudurier
Tue Mar 3 08:40:50 CET 2009


On 3/2/2009 11:09 PM, Alex Converse wrote:
> On Tue, Mar 3, 2009 at 2:05 AM, Alex Converse <alex.converse at gmail.com> wrote:
>> Hi,
>>
>> $subj.
>>
>> Ref: ISO/IEC 14496-12:2008 ? 8.7.3
>> Sample ISO/IEC 14496-4:2004/Amd.24:2008 a7-tone-oddities.mp4
>>
>> Regards,
>> Alex Converse
>>
> 
> Please ignore the previous attachment and use this one instead.
> 
> [...]
>
> @@ -1143,8 +1150,30 @@ static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
>      if (!sc->sample_sizes)
>          return AVERROR(ENOMEM);
>  
> +    switch(field_size) {
> +    case 4:
> +        for(i=0; i<entries; i++) {
> +            int field = get_byte(pb);
> +            sc->sample_sizes[i] = field >> 4;
> +            sc->sample_sizes[i] = field & 0xF;

This is incorrect I think.

> +        }
> +        break;
> +    case 8:
> +        for(i=0; i<entries; i++)
> +            sc->sample_sizes[i] = get_byte(pb);
> +        break;
> +    case 16:
> +        for(i=0; i<entries; i++)
> +            sc->sample_sizes[i] = get_be16(pb);
> +        break;
> +    case 32:
>      for(i=0; i<entries; i++)
>          sc->sample_sizes[i] = get_be32(pb);

I believe an "if" should be cleaner, inside the loop, what do you think
? You can check for wrong value before.

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org




More information about the ffmpeg-devel mailing list