diff --git a/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c b/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c index 23b0ce09ca..58037e0414 100644 --- a/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c +++ b/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c @@ -1662,8 +1662,8 @@ gst_h264_parse_clear_backlog (GstH264Parse * h264parse) static gboolean gst_h264_parse_process_backlog_loop (GstH264Parse * h264parse, - gint curr_next_thresh, gboolean adjust_offset_for_next, - gboolean * aud_insert, guint8 * data, gint * framesize) + gint curr_next_thresh, gboolean * aud_insert, guint8 * data, + gint * framesize) { GstH264NalUnit *bnalu; gint i, size = 0; @@ -1681,7 +1681,7 @@ gst_h264_parse_process_backlog_loop (GstH264Parse * h264parse, size = bnalu->offset + bnalu->size; h264parse->bl_next_nal = i + 1; - } else if (adjust_offset_for_next) { + } else { /* section of backlog that belong to next AU */ bnalu->offset -= size; bnalu->sc_offset -= size; @@ -1717,11 +1717,10 @@ gst_h264_parse_process_backlog_nal (GstH264Parse * h264parse, gint * proc_size, * insert a AUD. If the first nal from next AU is a AUD we don't need to wait * the completion the first vcl from next AU, AUD is the start of next AU. */ - if (!gst_h264_parse_process_backlog_loop (h264parse, - h264parse->bl_next_au_first_nal, FALSE, aud_insert, data, - &framesize)) { + if (gst_h264_parse_process_backlog_loop (h264parse, + h264parse->bl_next_au_first_nal, aud_insert, data, + &framesize) == FALSE) goto fail; - } /* We've processed a complete AU */ if (au_completed) { @@ -1729,10 +1728,9 @@ gst_h264_parse_process_backlog_nal (GstH264Parse * h264parse, gint * proc_size, } /* Process all backlog. Used when draining or output in NAL mode. */ - if (!gst_h264_parse_process_backlog_loop (h264parse, - h264parse->nal_backlog->len, TRUE, aud_insert, data, &framesize)) { + if (gst_h264_parse_process_backlog_loop (h264parse, + h264parse->nal_backlog->len, aud_insert, data, &framesize) == FALSE) goto fail; - } if (clear_bl) { gst_h264_parse_clear_backlog (h264parse); @@ -1765,11 +1763,10 @@ gst_h264_parse_process_backlog (GstH264Parse * h264parse, gint * proc_size, h264parse->nal_backlog->len - 1); h264parse->current_off = bnalu->offset + bnalu->size; - if (!gst_h264_parse_process_backlog_loop (h264parse, - h264parse->bl_next_au_first_nal, !proc_nau, aud_insert, data, - &framesize)) { + if (gst_h264_parse_process_backlog_loop (h264parse, + h264parse->bl_next_au_first_nal, aud_insert, data, + &framesize) == FALSE) goto fail; - } /* We've processed a complete AU */ if (h264parse->bl_next_au_first_nal < h264parse->nal_backlog->len) { @@ -1778,16 +1775,9 @@ gst_h264_parse_process_backlog (GstH264Parse * h264parse, gint * proc_size, /* Process all backlog. Used when draining or output in NAL mode. */ if (proc_nau) { - gint drain_size = 0; - if (!gst_h264_parse_process_backlog_loop (h264parse, - h264parse->nal_backlog->len, TRUE, aud_insert, data, &drain_size)) { + if (gst_h264_parse_process_backlog_loop (h264parse, + h264parse->nal_backlog->len, aud_insert, data, &framesize) == FALSE) goto fail; - } - - /* returned size is pointing the byte position of the last nalu end. - * do not accumulate but replace with last nalu position */ - if (drain_size > 0) - framesize = drain_size; } if (clear_bl) {