diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c
index 7afa5dd..ee3ade5 100644
--- a/gst-libs/gst/rtp/gstbasertpdepayload.c
+++ b/gst-libs/gst/rtp/gstbasertpdepayload.c
@@ -579,11 +579,10 @@ gst_base_rtp_depayload_packet_lost (GstBaseRTPDepayload * filter,
   s = gst_event_get_structure (event);
 
   /* first start by parsing the timestamp and duration */
-  timestamp = -1;
-  duration = -1;
-
-  gst_structure_get_clock_time (s, "timestamp", &timestamp);
-  gst_structure_get_clock_time (s, "duration", &duration);
+  if (G_UNLIKELY (!gst_structure_get_clock_time (s, "timestamp", &timestamp)))
+    timestamp = -1;
+  if (G_UNLIKELY (!gst_structure_get_clock_time (s, "duration", &duration)))
+    duration = -1;
 
   position = timestamp;
   if (duration != -1)
