[FFmpeg-devel] [PATCH] mxfdec: Parse IndexTableSegments and convert them into AVIndexEntry arrays

Georg Lippitsch georg.lippitsch at gmx.at
Mon Oct 10 22:56:49 CEST 2011

Am 10.10.2011, 13:03 Uhr, schrieb Tomas Härdin <tomas.hardin at codemill.se>:

>> Actually I didn't like this kind of audio handling very much, so I wrote
>> another patch for this.
>> After all, it avoids parsing the index table and furthermore generating
>> st->index_entries if there is only one table-segment, and if this  
>> segments
>> has no entries but only EditUnitByteCount set. It is meant to handle the
>> audio-files with small EditUnitByteCount correctly, and certainly also
>> saves much memory in this case.
> Sounds reasonable I suppose. While I'm not the biggest fan of having
> different code paths here, the proposed way is at least easy to
> understand.

As discussed on IRC, what I want to avoid is seeking in chunks of 8192  
bytes. As long as there is no better idea around on how doing this, a  
different code path is acceptable IMHO.

> You should probably make sure klv.length % samples_per_byte == 0. 24-bit
> could have a problem with this. For instance, PAL mono 24-bit 48 kHz ->
> 5760 B, meaning it'd pick 8192 which isn't divisible by 3.

What I've done now is simply multiplying EUBC by 1920 if it is very small  
(< 32). This should imply klv.length % samples_per_byte == 0
Updated patch attached.

> Shouldn't this also do FFMIN() with current_klv_data.length just like
> below?

Yes, sorry for forgetting.

>> -        seekpos =  st->index_entries[index].pos;
>> +        seekpos = st->index_entries[index].pos;
> Not intended?

Actually a minor cosmetic change, didn't like the double blank.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mxfdec-Avoid-index-table-parsing-if-only-a-single-se.patch
Type: text/x-patch
Size: 4126 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111010/c18d2e93/attachment.bin>

More information about the ffmpeg-devel mailing list