rtppassthroughpay: fix critical in gst-inspect

gst_segment_to_running_time() will fail noisily
if the segment has not been initialised yet.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6151>
This commit is contained in:
Tim-Philipp Müller 2024-02-20 11:55:25 +00:00 committed by GStreamer Marge Bot
parent ce45e63dcc
commit 0a6948ee20
2 changed files with 7 additions and 3 deletions

View file

@ -15978,7 +15978,7 @@
"construct": false, "construct": false,
"construct-only": false, "construct-only": false,
"controllable": false, "controllable": false,
"default": "application/x-rtp-payload-stats, clock-rate=(uint)0, running-time=(guint64)18446744073709551615, seqnum=(uint)0, timestamp=(uint)0, ssrc=(uint)0, pt=(uint)128, seqnum-offset=(uint)0, timestamp-offset=(uint)0;", "default": "application/x-rtp-payload-stats, clock-rate=(uint)0, running-time=(guint64)0, seqnum=(uint)0, timestamp=(uint)0, ssrc=(uint)0, pt=(uint)128, seqnum-offset=(uint)0, timestamp-offset=(uint)0;",
"mutable": "null", "mutable": "null",
"readable": true, "readable": true,
"type": "GstStructure", "type": "GstStructure",

View file

@ -452,8 +452,12 @@ gst_rtp_passthrough_pay_create_stats (GstRtpPassthroughPay * self)
{ {
GstClockTime running_time; GstClockTime running_time;
running_time = gst_segment_to_running_time (&self->segment, GST_FORMAT_TIME, if (self->segment.format == GST_FORMAT_UNDEFINED) {
self->pts_or_dts); running_time = 0;
} else {
running_time = gst_segment_to_running_time (&self->segment, GST_FORMAT_TIME,
self->pts_or_dts);
}
return gst_structure_new ("application/x-rtp-payload-stats", "clock-rate", return gst_structure_new ("application/x-rtp-payload-stats", "clock-rate",
G_TYPE_UINT, (guint) self->clock_rate, "running-time", G_TYPE_UINT64, G_TYPE_UINT, (guint) self->clock_rate, "running-time", G_TYPE_UINT64,