rtp: fix unmap calls
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 13 Mar 2012 16:27:32 +0000 (17:27 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 13 Mar 2012 16:27:32 +0000 (17:27 +0100)
gst/rtp/gstrtph264depay.c
gst/rtp/gstrtpmp4gdepay.c

index 3e39606..9a5c8f2 100644 (file)
@@ -558,6 +558,8 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
           &out_keyframe);
 
     /* add to adapter */
+    gst_buffer_unmap (nal, &map);
+
     GST_DEBUG_OBJECT (depayload, "adding NAL to picture adapter");
     gst_adapter_push (rtph264depay->picture_adapter, nal);
     rtph264depay->last_ts = in_timestamp;
@@ -571,8 +573,8 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
     /* no merge, output is input nal */
     GST_DEBUG_OBJECT (depayload, "using NAL as output");
     outbuf = nal;
+    gst_buffer_unmap (nal, &map);
   }
-  gst_buffer_unmap (nal, &map);
 
   if (outbuf) {
     /* prepend codec_data */
index e619e5b..c86cc6a 100644 (file)
@@ -453,8 +453,6 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
     rtptime = gst_rtp_buffer_get_timestamp (&rtp);
     M = gst_rtp_buffer_get_marker (&rtp);
 
-    gst_rtp_buffer_unmap (&rtp);
-
     if (rtpmp4gdepay->sizelength > 0) {
       gint num_AU_headers, AU_headers_bytes, i;
       GstBsParse bs;