avcodec/packet_internal: Add proper PacketList struct

Up until now, we had a PacketList structure which is actually
a PacketListEntry; a proper PacketList did not exist
and all the related functions just passed pointers to pointers
to the head and tail elements around. All these pointers were
actually consecutive elements of their containing structs,
i.e. the users already treated them as if they were a struct.

So add a proper PacketList struct and rename the current PacketList
to PacketListEntry; also make the functions use this structure
instead of the pair of pointers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2021-12-16 01:49:39 +01:00
parent b74e47c4ff
commit d61240f8c9
20 changed files with 153 additions and 175 deletions

View File

@@ -70,9 +70,7 @@ static int mov_write_ttml_document_from_queue(AVFormatContext *s,
return ret;
}
while (!avpriv_packet_list_get(&track->squashed_packet_queue,
&track->squashed_packet_queue_end,
pkt)) {
while (!avpriv_packet_list_get(&track->squashed_packet_queue, pkt)) {
end_ts = FFMAX(end_ts, pkt->pts + pkt->duration);
// in case of the 'dfxp' muxing mode, each written document is offset
@@ -121,7 +119,7 @@ int ff_mov_generate_squashed_ttml_packet(AVFormatContext *s,
goto cleanup;
}
if (!track->squashed_packet_queue) {
if (!track->squashed_packet_queue.head) {
// empty queue, write minimal empty document with zero duration
avio_write(ttml_ctx->pb, empty_ttml_document,
sizeof(empty_ttml_document) - 1);