From d11a0d04ecd50c3b921c3566c8d7507e521c8816 Mon Sep 17 00:00:00 2001 From: Eric Knapp Date: Tue, 26 Jul 2022 13:59:33 -0400 Subject: [PATCH] va: h264enc: Make AUD the first NAL unit Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvah264enc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c index de462a58bd..c6813333b9 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah264enc.c @@ -2702,6 +2702,12 @@ _encode_one_frame (GstVaH264Enc * self, GstVideoCodecFrame * gst_frame) frame = _enc_frame (gst_frame); + if (self->prop.aud) { + if ((self->packed_headers & VA_ENC_PACKED_HEADER_RAW_DATA) + && !_add_aud (self, frame)) + return FALSE; + } + /* Repeat the SPS for IDR. */ if (frame->poc == 0) { VAEncSequenceParameterBufferH264 sequence; @@ -2739,12 +2745,6 @@ _encode_one_frame (GstVaH264Enc * self, GstVideoCodecFrame * gst_frame) return FALSE; } - if (self->prop.aud) { - if ((self->packed_headers & VA_ENC_PACKED_HEADER_RAW_DATA) - && !_add_aud (self, frame)) - return FALSE; - } - /* Non I frame, construct reference list. */ if (frame->type != GST_H264_I_SLICE) { GstVaH264EncFrame *vaf;