diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-16 01:49:39 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-04 13:16:50 +0100 |
commit | d61240f8c95e9cf7a0aaef2bb4495960d3fec62c (patch) | |
tree | 52398ddaec0cbe4e02d0db54669ecd1532f1569e /libavformat/mxfenc.c | |
parent | b74e47c4ff5bca998936c0d8b9a0892104a7403d (diff) |
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>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r-- | libavformat/mxfenc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 4c02e3e264..5e068c8220 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -3097,9 +3097,9 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, int flus stream_count += !!ffstream(s->streams[i])->last_in_packet_buffer; if (stream_count && (s->nb_streams == stream_count || flush)) { - PacketList *pktl = si->packet_buffer; + PacketListEntry *pktl = si->packet_buffer.head; if (s->nb_streams != stream_count) { - PacketList *last = NULL; + PacketListEntry *last = NULL; // find last packet in edit unit while (pktl) { if (!stream_count || pktl->pkt.stream_index == 0) @@ -3113,7 +3113,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, int flus } // purge packet queue while (pktl) { - PacketList *next = pktl->next; + PacketListEntry *next = pktl->next; av_packet_unref(&pktl->pkt); av_freep(&pktl); pktl = next; @@ -3121,16 +3121,16 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, int flus if (last) last->next = NULL; else { - si->packet_buffer = NULL; - si->packet_buffer_end = NULL; + si->packet_buffer.head = NULL; + si->packet_buffer.tail = NULL; goto out; } - pktl = si->packet_buffer; + pktl = si->packet_buffer.head; } if (ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer == pktl) ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer = NULL; - avpriv_packet_list_get(&si->packet_buffer, &si->packet_buffer_end, out); + avpriv_packet_list_get(&si->packet_buffer, out); av_log(s, AV_LOG_TRACE, "out st:%d dts:%"PRId64"\n", out->stream_index, out->dts); return 1; } else { |