From 62d9ef42d491cda8a6aaca27eaa6c8c255262a76 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 25 May 2011 13:53:21 +0200 Subject: [PATCH] h264parse: fix clearing adapter forming avc output frame ... which needs to be reset upon a new frame and otherwise (only) for avc input in passthrough mode (rather than on every chain call). --- gst/videoparsers/gsth264parse.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 2b55f2feae..7ca52d610b 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -171,6 +171,7 @@ gst_h264_parse_reset_frame (GstH264Parse * h264parse) h264parse->idr_pos = -1; h264parse->keyframe = FALSE; h264parse->frame_start = FALSE; + gst_adapter_clear (h264parse->frame_out); } static void @@ -1139,13 +1140,14 @@ gst_h264_parse_chain (GstPad * pad, GstBuffer * buffer) } if (h264parse->split_packetized) return ret; + else { + /* nal processing in pass-through might have collected stuff; + * ensure nothing happens with this later on */ + gst_adapter_clear (h264parse->frame_out); + } } exit: - /* nal processing in pass-through might have collected stuff; - * ensure nothing happens with this later on */ - gst_adapter_clear (h264parse->frame_out); - return h264parse->parse_chain (pad, buffer); /* ERRORS */