gst-plugins-bad: h264parse: use proper NALU offset for config data insertion

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Wed Feb 15 05:30:13 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: 5cce89b048e59e3b347b6a9521b18d8887a2c3d7
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=5cce89b048e59e3b347b6a9521b18d8887a2c3d7

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Wed Feb 15 14:29:23 2012 +0100

h264parse: use proper NALU offset for config data insertion

... which has to be the position of the start code, which is almost always
but need not be 4 bytes.

---

 gst/videoparsers/gsth264parse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 545a08d..ea0d084 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -522,7 +522,7 @@ gst_h264_parse_process_nal (GstH264Parse * h264parse, GstH264NalUnit * nalu)
         if (h264parse->format == GST_H264_PARSE_FORMAT_AVC)
           h264parse->sei_pos = gst_adapter_available (h264parse->frame_out);
         else
-          h264parse->sei_pos = nalu->offset - 4;
+          h264parse->sei_pos = nalu->sc_offset;
         GST_DEBUG_OBJECT (h264parse, "marking SEI in frame at offset %d",
             h264parse->sei_pos);
       }
@@ -565,7 +565,7 @@ gst_h264_parse_process_nal (GstH264Parse * h264parse, GstH264NalUnit * nalu)
         if (h264parse->format == GST_H264_PARSE_FORMAT_AVC)
           h264parse->idr_pos = gst_adapter_available (h264parse->frame_out);
         else
-          h264parse->idr_pos = nalu->offset - 4;
+          h264parse->idr_pos = nalu->sc_offset;
         GST_DEBUG_OBJECT (h264parse, "marking IDR in frame at offset %d",
             h264parse->idr_pos);
       }



More information about the gstreamer-commits mailing list