[FFmpeg-devel] [PATCH 1/2] Parse MXF partitions
Tomas Härdin
tomas.hardin at codemill.se
Wed May 18 09:39:30 CEST 2011
Baptiste Coudurier skrev 2011-05-17 18:00:
> Hi Tomas,
>
> On 05/17/2011 07:44 AM, Tomas Härdin wrote:
>> Forked from the thread "[PATCH] MXF index table based seeking" to avoid
>> cluttering the original thread up.
>>
>> Baptiste Coudurier skrev 2011-05-17 05:31:
>>>> typedef struct {
>>>> + MXFPartition **partitions;
>>>> + unsigned partitions_count;
>>>
>>> Any reason you don't use MXFPartition *partitions ?
>>> It avoids malloc for each partition.
>>
>> No reason at all. Reworked.
>>
>>>> [...]
>>>>
>>>> +
>>>> + /* consider both footers to be closed (there is only Footer and
>> CompleteFooter) */
>>>> + partition->closed = partition->type == Footer || !(uid[14]& 1);
>>>
>>> Do we really need to workaround here ?
>>
>> Not really a workaround, just a statement of fact. There's no such thing
>> as OpenFooter, hence we might as well set closed correctly.
>
> Patch ok, feel free to apply it when you want.
I'm on a Windows machine atm, so you could apply it for now. I suppose I
could mail in the SSH key for my virtual ubuntu machine, but I'd do that
later.
> About ClosedFooter, do you mean the 'closed' bit is not set and it's
> safer to override it ?
I'll just quote S377m:
5.2.7 Footer partition
The footer partition shall be the last partition in any MXF file and
there shall be zero or one such partition. A
footer partition shall be of type “closed” as defined in section 5.2.3.
A footer partition may be complete or
incomplete as defined in section 5.2.3.
So basically, a footer can't be open. They're always closed. That's why
there's only ten entries in mxf_metadata_read_table[] for
mxf_read_partition_pack() - four for HeaderPartition, four for
BodyPartition and two for FooterPartition.
Looking closer I see that there's no UID in that table that corresponds
to an open footer. Hence the workaround isn't needed since the function
will never get called with a "OpenFooter" UID. Feel free to fix that
when applying.
/Tomas
More information about the ffmpeg-devel
mailing list