[FFmpeg-devel] [RFC]Support G.726 in Sun AU

Paul B Mahol onemda at gmail.com
Sat Nov 24 10:37:43 CET 2012


On 11/24/12, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Paul B Mahol <onemda <at> gmail.com> writes:
>
>> > @@ -36,6 +36,10 @@
>> >  /* if we don't know the size in advance */
>> >  #define AU_UNKNOWN_SIZE ((uint32_t)(~0))
>> >
>> > +typedef struct {
>> > +    int bps;
>>
>> You could use bits_per_coded_sample?
>
> Yes, will change.
>
>> > @@ -145,7 +162,9 @@ static int au_read_header
>> >      codec = ff_codec_get_id(codec_au_tags, id);
>> >
>> > -    if (!(bps = av_get_bits_per_sample(codec))) {
>> > +    if (codec == AV_CODEC_ID_ADPCM_G726) {
>> > +        au->bps = (uint8_t []){4, 0, 3, 5}[id - 23];
>>
>> bps could become 0 in future causing division by 0 in later code.
>
> Could you explain how it can become 0, I don't understand?

If someone adds G726 codec with id 24 but does not change this line.
It is just remark that code looks somehow ugly....

>
> Thank you, Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list