On Wed, May 18, 2011 at 2:28 PM, Benjamin Larsson <[email protected]> wrote:
>
>>> + // HACK true for mono and stereo
>>> + ac->m4ac.chan_config = avctx->channels;
>> This is trivial to fix
>>
>
> Ok, would be good to get some help with that.
>
Iterate through ff_mpeg4audio_channels[], if you find no matches then fail.
>>> + set_default_channel_config(avctx, new_che_pos,
>>> ac->m4ac.chan_config);
>>> + output_configure(ac, ac->che_pos, new_che_pos,
>>> ac->m4ac.chan_config, OC_GLOBAL_HDR);
>> We don't want to OC_GLOBAL_HDR on ADTS streams.
>
> Ok, what should it be then ?
>
We need a way to tell if this is an ADTS stream or a stream with an
out of band configuration. Normally we use extradata_size to do that.
>>> }
>>>
>>> avctx->sample_fmt = AV_SAMPLE_FMT_S16;
>>> diff --git a/libavformat/utils.c b/libavformat/utils.c
>>> index 67aa76a..4bc6005 100644
>>> --- a/libavformat/utils.c
>>> +++ b/libavformat/utils.c
>>> @@ -2162,9 +2162,9 @@ int av_find_stream_info(AVFormatContext *ic)
>>> AVCodec *codec;
>>> st = ic->streams[i];
>>> if (st->codec->codec_id == CODEC_ID_AAC) {
>>> - st->codec->sample_rate = 0;
>>> +// st->codec->sample_rate = 0;
>>> st->codec->frame_size = 0;
>>> - st->codec->channels = 0;
>>> +// st->codec->channels = 0;
>> I think this breaks implicit PS
>>
>
> What it does is that it forces the codec to try to decode the stream to
> be able to get the codec parameters instead of using the data from the
> container. I need to keep the sample rate and channels from the
> container somehow. I try to cook something up that works without
> breaking PS.
>
For implicit signalling the sample rate and channel count in the
container only cover the LC portion of the stream and SBR and PS both
revise those figures. We need to decode a frame to figure out what we
actually have.
Now I'll admit the current set up has some drawbacks and I have
entertained the thought of removing detection and given implicit
signalling forcing SBR on for low sample rates (like libfaad2) and
forcing PS on for mono streams with SBR. In particular we've always
been bad at reconfiguring, and PS isn't visible when SBR is in "pure
up sampling mode."
Regards,
Alex
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel