From 53ffd9e1cab086f334f94597973fdb0fcb175adc Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6ran=20J=C3=B6nsson?= Date: Tue, 11 Feb 2014 12:41:29 +0100 Subject: [PATCH] rtph264pay: only update last_spspps time if all sps/pps got sent successfully This fixes an issue with gst-rtsp-server where no sps and pps are sent for the first intra frame, because the payloader starts working already when receiving DESCRIBE but there is no transports so it tries to send sps and pps, but that fails with a FLUSHING flow. But the time for last sent sps and pps would still be set, so when PLAY arrives and the first intra frame is to be sent there is no sps and pps sent due to that time since last sps pps is less than spspps_interval. https://bugzilla.gnome.org/show_bug.cgi?id=724213 --- gst/rtp/gstrtph264pay.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c index 55e06f5..86c3570 100644 --- a/gst/rtp/gstrtph264pay.c +++ b/gst/rtp/gstrtph264pay.c @@ -711,6 +711,7 @@ gst_rtp_h264_pay_send_sps_pps (GstRTPBasePayload * basepayload, GstRtpH264Pay * rtph264pay, GstClockTime dts, GstClockTime pts) { GstFlowReturn ret = GST_FLOW_OK; + gboolean sent_all_sps_pps = TRUE; guint i; for (i = 0; i < rtph264pay->sps->len; i++) { @@ -722,8 +723,10 @@ gst_rtp_h264_pay_send_sps_pps (GstRTPBasePayload * basepayload, ret = gst_rtp_h264_pay_payload_nal (basepayload, gst_buffer_ref (sps_buf), dts, pts, FALSE); /* Not critical here; but throw a warning */ - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + sent_all_sps_pps = FALSE; GST_WARNING ("Problem pushing SPS"); + } } for (i = 0; i < rtph264pay->pps->len; i++) { GstBuffer *pps_buf = @@ -734,11 +737,13 @@ gst_rtp_h264_pay_send_sps_pps (GstRTPBasePayload * basepayload, ret = gst_rtp_h264_pay_payload_nal (basepayload, gst_buffer_ref (pps_buf), dts, pts, FALSE); /* Not critical here; but throw a warning */ - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + sent_all_sps_pps = FALSE; GST_WARNING ("Problem pushing PPS"); + } } - if (pts != -1) + if (pts != -1 && sent_all_sps_pps) rtph264pay->last_spspps = pts; return ret; -- 2.7.4