h264pay: fix config-interval property
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 19 Mar 2010 16:09:06 +0000 (17:09 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 19 Mar 2010 16:13:07 +0000 (17:13 +0100)
Use the same units for comparing the elapsed time against the interval.

Fixes #613013

gst/rtp/gstrtph264pay.c

index 5ea9c98..bccabcc 100644 (file)
@@ -640,18 +640,24 @@ gst_rtp_h264_pay_payload_nal (GstBaseRTPPayload * basepayload, guint8 * data,
   /* check if we need to emit an SPS/PPS now */
   if (nalType == IDR_TYPE_ID && rtph264pay->spspps_interval > 0) {
     if (rtph264pay->last_spspps != -1) {
-      guint diff;
+      guint64 diff;
+
+      GST_LOG_OBJECT (rtph264pay,
+          "now %" GST_TIME_FORMAT ", last SPS/PPS %" GST_TIME_FORMAT,
+          GST_TIME_ARGS (timestamp), GST_TIME_ARGS (rtph264pay->last_spspps));
 
       /* calculate diff between last SPS/PPS in milliseconds */
       if (timestamp > rtph264pay->last_spspps)
-        diff = GST_TIME_AS_MSECONDS (timestamp - rtph264pay->last_spspps);
+        diff = timestamp - rtph264pay->last_spspps;
       else
         diff = 0;
 
-      GST_DEBUG_OBJECT (rtph264pay, "interval since last SPS/PPS %ums", diff);
+      GST_DEBUG_OBJECT (rtph264pay,
+          "interval since last SPS/PPS %" GST_TIME_FORMAT,
+          GST_TIME_ARGS (diff));
 
       /* bigger than interval, queue SPS/PPS */
-      if (diff >= (rtph264pay->spspps_interval * GST_MSECOND)) {
+      if (GST_TIME_AS_SECONDS (diff) >= rtph264pay->spspps_interval) {
         GST_DEBUG_OBJECT (rtph264pay, "time to send SPS/PPS");
         send_spspps = TRUE;
       }