summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-24 19:41:16 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-09-17 13:22:25 +0200
commit40bdd8cc05d9c98a18cf2b1c2a00c8a5a7b38113 (patch)
tree0fc408f78b9b6934ac351cd4499c07737f8f6a62 /libavformat/mxfenc.c
parent9f05b3ba604a30eeb6f5ff877b8b5b5c93a268d7 (diff)
avformat: Avoid allocation for AVStreamInternal
Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 8e57e10487..f37606ed89 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -3104,7 +3104,7 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
int i, stream_count = 0;
for (i = 0; i < s->nb_streams; i++)
- stream_count += !!s->streams[i]->internal->last_in_packet_buffer;
+ stream_count += !!ffstream(s->streams[i])->last_in_packet_buffer;
if (stream_count && (s->nb_streams == stream_count || flush)) {
PacketList *pktl = si->packet_buffer;
@@ -3115,8 +3115,8 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
if (!stream_count || pktl->pkt.stream_index == 0)
break;
// update last packet in packet buffer
- if (s->streams[pktl->pkt.stream_index]->internal->last_in_packet_buffer != pktl)
- s->streams[pktl->pkt.stream_index]->internal->last_in_packet_buffer = pktl;
+ if (ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer != pktl)
+ ffstream(s->streams[pktl->pkt.stream_index])->last_in_packet_buffer = pktl;
last = pktl;
pktl = pktl->next;
stream_count--;
@@ -3141,8 +3141,8 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
*out = pktl->pkt;
av_log(s, AV_LOG_TRACE, "out st:%d dts:%"PRId64"\n", (*out).stream_index, (*out).dts);
si->packet_buffer = pktl->next;
- if(s->streams[pktl->pkt.stream_index]->internal->last_in_packet_buffer == pktl)
- s->streams[pktl->pkt.stream_index]->internal->last_in_packet_buffer= NULL;
+ 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;
if (!si->packet_buffer)
si->packet_buffer_end = NULL;
av_freep(&pktl);