[FFmpeg-devel] [PATCH] mp3 in oma support
Benjamin Larsson
banan
Mon Jun 23 09:36:12 CEST 2008
Michael Niedermayer wrote:
> On Sun, Jun 22, 2008 at 10:54:44PM +0200, Benjamin Larsson wrote:
>
>> $topic
>>
>> MvH
>> Benjamin Larsson
>>
>
> [...]
>
>> @@ -111,8 +117,8 @@
>>
>> framesize = (codec_params & 0x3FF) * 8;
>> jsflag = (codec_params >> 17) & 1; /* get stereo coding mode, 1 for joint-stereo */
>> - channel_id = 2;
>> -
>> + st->codec->channels = 2;
>>
>
> If the channel_id is just valid for one codec then the respective code
> should be in the specific case in the swicth, the same applies to the
> sample rate
>
Ok, I'll change.
>
> [...]
>
>> + case OMA_CODECID_MP3:
>> + {
>> + uint32_t header;
>> +
>> + url_fseek(s->pb, EA3_pos + EA3_HEADER_SIZE, SEEK_SET);
>> + ret = get_buffer(s->pb, buf, 4);
>> + header = AV_RB32(buf);
>> + framesize = ff_mpa_decode_header(st->codec,header,&samplerate);
>> + if(framesize==-1) {
>> + av_log(s, AV_LOG_ERROR, "Valid MP3 header not found!\n");
>> + return -1;
>> + }
>> + st->need_parsing = AVSTREAM_PARSE_FULL;
>> + break;
>> + }
>>
>
> except need_parsing this looks unneeded
>
>
ff_mpa_decode_header fills in the bit_rate, sample_rate and amount of channels. Without that it wont play.
MvH
Benjamin Larsson
More information about the ffmpeg-devel
mailing list