13
0

Update libaaf to v1.0-11-gb04c547

This commit is contained in:
agfline 2024-04-17 23:56:57 +02:00 committed by Robin Gareus
parent 895fe2f753
commit 41587d3c06
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
16 changed files with 158 additions and 101 deletions

View File

@ -888,3 +888,44 @@ externalAudioDataReaderCallback (unsigned char* buf, size_t offset, size_t reqle
return byteRead;
}
aafiAudioEssencePointer*
aafi_audioEssencePointer_exists_before (AAF_Iface* aafi, aafiAudioEssencePointer* audioEssencePointerList)
{
aafiAudioTrack* at = NULL;
aafiTimelineItem* ai = NULL;
aafiAudioClip* ac = NULL;
aafiAudioEssencePointer* aep1 = NULL;
aafiAudioEssencePointer* aep2 = NULL;
AAFI_foreachAudioTrack (aafi, at)
{
AAFI_foreachTrackItem (at, ai)
{
if (ai->type != AAFI_AUDIO_CLIP) {
continue;
}
ac = (aafiAudioClip*)ai->data;
aep1 = audioEssencePointerList;
int found = 1;
AAFI_foreachEssencePointer (ac->essencePointerList, aep2)
{
if (!aep1 || aep1->essenceFile != aep2->essenceFile || aep1->essenceChannel != aep2->essenceChannel) {
found = 0;
break;
}
aep1 = aep1->next;
}
if (found && aep1 == NULL) {
return ac->essencePointerList;
}
}
}
return NULL;
}

View File

@ -3166,12 +3166,23 @@ aafi_retrieveData (AAF_Iface* aafi)
AAFI_foreachTrackItem (audioTrack, audioItem)
{
if (audioItem->type == AAFI_TRANS) {
if (audioItem->type != AAFI_AUDIO_CLIP) {
continue;
}
audioClip = (aafiAudioClip*)audioItem->data;
audioClip->channels = aafi_getAudioEssencePointerChannelCount (audioClip->essencePointerList);
/*
* we check if any previous clip is using the exact same essence pointer,
* to avoid duplication and allow to detect when multiple clips are using
* the same essence.
*/
aafiAudioEssencePointer* prev = aafi_audioEssencePointer_exists_before (aafi, audioClip->essencePointerList);
if (prev) {
audioClip->essencePointerList = prev;
}
}
}

View File

@ -214,6 +214,12 @@ aafi_release (AAF_Iface** aafi)
aafi_freeAudioTracks (&(*aafi)->Audio->Tracks);
aafi_freeAudioEssences (&(*aafi)->Audio->essenceFiles);
aafiAudioEssencePointer* essencePointer = (*aafi)->Audio->essencePointerList;
while (essencePointer) {
essencePointer = aafi_freeAudioEssencePointer (essencePointer);
}
free ((*aafi)->Audio);
}
@ -798,10 +804,10 @@ aafi_newAudioEssencePointer (AAF_Iface* aafi, aafiAudioEssencePointer** list, aa
last->next = essencePointer;
} else {
*list = essencePointer;
}
essencePointer->aafiNext = aafi->Audio->essencePointerList;
aafi->Audio->essencePointerList = essencePointer;
}
return *list;
}
@ -985,8 +991,6 @@ aafi_freeAudioClip (aafiAudioClip* audioClip)
aafi_freeAudioGain (audioClip->automation);
aafi_freeMetadata (&(audioClip->metadata));
aafi_freeAudioEssencePointer (audioClip->essencePointerList);
free (audioClip);
}
@ -1042,16 +1046,14 @@ aafi_freeMetadata (aafiMetaData** CommentList)
*CommentList = NULL;
}
void
aafiAudioEssencePointer*
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* essencePointer)
{
aafiAudioEssencePointer* next = NULL;
aafiAudioEssencePointer* next = essencePointer->aafiNext;
while (essencePointer) {
next = essencePointer->next;
free (essencePointer);
essencePointer = next;
}
return next;
}
void

View File

@ -55,6 +55,9 @@ aafi_parse_audio_essence (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenceFil
int
aafi_build_unique_audio_essence_name (AAF_Iface* aafi, aafiAudioEssenceFile* audioEssenceFile);
aafiAudioEssencePointer*
aafi_audioEssencePointer_exists_before (AAF_Iface* aafi, aafiAudioEssencePointer* audioEssencePointerList);
/**
* @}
*/

View File

@ -1060,7 +1060,7 @@ aafi_freeMarkers (aafiMarker** aafi);
void
aafi_freeMetadata (aafiMetaData** CommentList);
void
aafiAudioEssencePointer*
aafi_freeAudioEssencePointer (aafiAudioEssencePointer* audioEssenceGroupEntry);
void

View File

@ -1,2 +1,2 @@
#pragma once
#define LIBAAF_VERSION "v1.0-10-g13f0b0a"
#define LIBAAF_VERSION "v1.0-11-gb04c547"