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

@@ -5339,7 +5339,7 @@ static int mov_write_squashed_packet(AVFormatContext *s, MOVTrack *track)
switch (track->st->codecpar->codec_id) {
case AV_CODEC_ID_TTML: {
int had_packets = !!track->squashed_packet_queue;
int had_packets = !!track->squashed_packet_queue.head;
if ((ret = ff_mov_generate_squashed_ttml_packet(s, track, squashed_packet)) < 0) {
goto finish_squash;
@@ -6190,7 +6190,6 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt)
/* The following will reset pkt and is only allowed to be used
* because we return immediately. afterwards. */
if ((ret = avpriv_packet_list_put(&trk->squashed_packet_queue,
&trk->squashed_packet_queue_end,
pkt, NULL, 0)) < 0) {
return ret;
}
@@ -6478,8 +6477,7 @@ static void mov_free(AVFormatContext *s)
ff_mov_cenc_free(&track->cenc);
ffio_free_dyn_buf(&track->mdat_buf);
avpriv_packet_list_free(&track->squashed_packet_queue,
&track->squashed_packet_queue_end);
avpriv_packet_list_free(&track->squashed_packet_queue);
}
av_freep(&mov->tracks);