[Ffmpeg-devel] [PATCH]ogg flac

Måns Rullgård mru
Thu May 12 00:45:51 CEST 2005


matthieu castet <castet.matthieu at free.fr> writes:

> M?ns Rullg?rd wrote:
>> matthieu castet <castet.matthieu at free.fr> writes:
>>
>>>
>>>PS : shouldn't we add a id for flac in codec_wav_tags, if we want to
>>>transcode flac in another format ?
>> Is there one in common use?
>>
> don't know : mux it in nut with a clip for example...
>>>    int *header_number = os->private;
>>>
>>>    if (!os->private)
>>>        os->private = header_number = av_mallocz(sizeof(int));
>>>
>>>    if (os->seq > *header_number)
>>>        return 0;
>> Why don't you just examine the first byte of the packet?  This is
>> better for two reasons: 1) it's simpler, and 2) the header number is
>> allowed to be zero, in which case this will break.
>>
> header_number will nerver be 0 as there always the comment header
> ("The first packet is followed by one or more header packets.") Even
> if it was allow to be 0, I don't see were it could break : at the next
> call we will have 1 > 0, and it will return 0.

"A two-byte, big-endian binary number signifying the number of header
(non-audio) packets, not including this one. This number may be zero
(0x0000) to signify 'unknown' but be aware that some decoders may not
be able to handle such streams."

> Why I do this : because we are in the ogg layer and I don't want to
> parse flac stream, flac decoder already do that.

Geez, it's just about looking at one byte.  We're already parsing
flac-specific things, so where's the big deal.

Anyway, I've shuffled your code a bit to use my approach, and it seems
to be working.  I'll be checking it in shortly.

-- 
M?ns Rullg?rd
mru at inprovide.com





More information about the ffmpeg-devel mailing list