[FFmpeg-devel,08/12] avformat/mxfenc: fix muxing when audio tracks are longer than video track

Submitted by Baptiste Coudurier on July 4, 2018, 6:35 p.m.

Details

Message ID 20180704183514.71654-8-baptiste.coudurier@gmail.com
State Accepted
Commit 955a989341a5d43ba88f746b6325f5be35b48146
Headers show

Commit Message

Baptiste Coudurier July 4, 2018, 6:35 p.m.
---
 libavformat/mxfenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Baptiste Coudurier July 19, 2018, 3:39 p.m.
On Wed, Jul 4, 2018 at 11:35 AM, Baptiste Coudurier <
baptiste.coudurier@gmail.com> wrote:

> ---
>  libavformat/mxfenc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>

Will apply.
Baptiste Coudurier Aug. 21, 2018, 7:16 p.m.
On Thu, Jul 19, 2018 at 8:39 AM, Baptiste Coudurier <
baptiste.coudurier@gmail.com> wrote:

> On Wed, Jul 4, 2018 at 11:35 AM, Baptiste Coudurier <
> baptiste.coudurier@gmail.com> wrote:
>
>> ---
>>  libavformat/mxfenc.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>
> Will apply.
>

Applied.

Patch hide | download patch | download mbox

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 1f272ce6e5..036adce011 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2935,6 +2935,9 @@  static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
             while (pktl) {
                 if (!stream_count || pktl->pkt.stream_index == 0)
                     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;
                 pktl = pktl->next;
                 stream_count--;
@@ -2942,9 +2945,6 @@  static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket
             // purge packet queue
             while (pktl) {
                 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_freep(&pktl);
                 pktl = next;