[FFmpeg-devel] [PATCH] Parsing ALS object type in MPEG-4

Thilo Borgmann thilo.borgmann
Sat Sep 26 11:51:41 CEST 2009


Alex Converse schrieb:
> On Fri, Sep 18, 2009 at 6:42 PM, Baptiste Coudurier
> <baptiste.coudurier at gmail.com> wrote:
>> Hi,
>>
>> On 09/18/2009 03:35 PM, Thilo Borgmann wrote:
>>> Alex Converse schrieb:
>>>> On Sun, Aug 23, 2009 at 3:51 PM, Thilo
>>>> Borgmann<thilo.borgmann at googlemail.com>  wrote:
>>>>> Revision 6 attached (rev. 5 skipped...)
>>>>>
>>>>> [...]
>>>>>
>>>>> Index: libavcodec/mpeg4audio.h
>>>>> ===================================================================
>>>>> --- libavcodec/mpeg4audio.h     (revision 19689)
>>>>> +++ libavcodec/mpeg4audio.h     (working copy)
>>>>> @@ -36,6 +36,7 @@
>>>>>     int ext_sampling_index;
>>>>>     int ext_sample_rate;
>>>>>     int ext_chan_config;
>>>>> +    int channels;
>>>>>  } MPEG4AudioConfig;
>>>>>
>>>>>  extern const int ff_mpeg4audio_sample_rates[16];
>>>>> Index: libavformat/mov.c
>>>>> ===================================================================
>>>>> --- libavformat/mov.c   (revision 19689)
>>>>> +++ libavformat/mov.c   (working copy)
>>>>> @@ -434,9 +434,13 @@
>>>>>                 MPEG4AudioConfig cfg;
>>>>>                 ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
>>>>>                                          st->codec->extradata_size);
>>>>> +                if (cfg.chan_config) {
>>>>>                 if (cfg.chan_config>  7)
>>>>>                     return -1;
>>>>>                 st->codec->channels =
>>>>> ff_mpeg4audio_channels[cfg.chan_config];
>>>>> +                } else {
>>>>> +                    st->codec->channels = cfg.channels;
>>>>> +                }
>>>>>                 if (cfg.object_type == 29&&  cfg.sampling_index<  3) //
>>>>> old mp3on4
>>>>>                     st->codec->sample_rate =
>>>>> ff_mpa_freq_tab[cfg.sampling_index];
>>>>>                 else
>>>> The rest of this seems OK but Rob and Baptiste are the maintainers here.
>> Maybe we should always set ->channels in mpeg4audio_get_config, that would
>> simplify the code everywhere else. What do you think ?
> 
> In principle that seems fine as long as it doesn't break muxing or
> decoding files with (those awful) PCEs. In practice this probably
> means adding yet more PCE code to mpeg4audio.[ch] since it doesn't
> look like there is any way to adapt ff_copy_pce_data (mpeg4audio.c) or
> decode_pce (aac.c) to this purpose.
> 
> I would also accept having this as an inevitable goal and leaving it
> on a todo list for a while. This whole multichannel business in MPEG 4
> audio was dreadfully thought out but there is nothing we can do about
> it now.

So........ I should move these "st->codec->channels = ..." into
ff_mpeg4audio_get_config() ?



More information about the ffmpeg-devel mailing list