Commit 955a9893 authored by Baptiste Coudurier's avatar Baptiste Coudurier

avformat/mxfenc: fix muxing when audio tracks are longer than video track

parent b8351ea0
...@@ -2914,6 +2914,9 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket ...@@ -2914,6 +2914,9 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
while (pktl) { while (pktl) {
if (!stream_count || pktl->pkt.stream_index == 0) if (!stream_count || pktl->pkt.stream_index == 0)
break; break;
// update last packet in packet buffer
if (s->streams[pktl->pkt.stream_index]->last_in_packet_buffer != pktl)
s->streams[pktl->pkt.stream_index]->last_in_packet_buffer = pktl;
last = pktl; last = pktl;
pktl = pktl->next; pktl = pktl->next;
stream_count--; stream_count--;
...@@ -2921,9 +2924,6 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket ...@@ -2921,9 +2924,6 @@ static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
// purge packet queue // purge packet queue
while (pktl) { while (pktl) {
AVPacketList *next = pktl->next; AVPacketList *next = pktl->next;
if(s->streams[pktl->pkt.stream_index]->last_in_packet_buffer == pktl)
s->streams[pktl->pkt.stream_index]->last_in_packet_buffer= NULL;
av_packet_unref(&pktl->pkt); av_packet_unref(&pktl->pkt);
av_freep(&pktl); av_freep(&pktl);
pktl = next; pktl = next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment