GNOME Bugzilla – Bug 747614
gst-rtsp-server: uninitialized clock rate causes critical warning
Last modified: 2015-04-27 10:42:55 UTC
During gst_rtsp_stream_transport_get_rtpinfo, clock rate is not initialized. If this can't get valid clock rate in gst_rtsp_stream_get_rtpinfo, it causes Gstreamer-CRITICAL message like below. 0:00:02.486835007 18340 0x9693a00 DEBUG rtspmediatransport rtsp-stream-transport.c:349:gst_rtsp_stream_transport_get_rtpinfo: RTP time 2787330729, seq 13871, rate 3077981536, running-time 0:00:00.000000000 (lt-test-mp4:18340): GStreamer-CRITICAL **: _gst_util_uint64_scale_int: assertion `num >= 0' failed 0:00:02.486903950 18340 0x9693a00 DEBUG rtspmediatransport rtsp-stream-transport.c:364:gst_rtsp_stream_transport_get_rtpinfo: RTP time 2787330728, for start-time 0:00:00.000000000 clock rate's tye is guint, but as an argument of _gst_util_uint64_scale_int, it is type-casted to gint. During this, clock rate turns negative value. It should be initialized.
Created attachment 301275 [details] [review] rtsp-stream-transport: Initialize clock rate before getting rtp info
How can this be reproduced? We should really never do anything with an invalid clock rate, and should actually get one here
Comment on attachment 301275 [details] [review] rtsp-stream-transport: Initialize clock rate before getting rtp info Instead of this, we need to make sure to actually get a clock rate when it is used later.
(In reply to Sebastian Dröge (slomo) from comment #2) > How can this be reproduced? We should really never do anything with an > invalid clock rate, and should actually get one here It's easy to reproduce. When you're running test-mp4, and then connect to this server by playbin, you can see this warning. Reason that it fails to get clock-rate, is that it's trying to get (int) clock rate by different typed variable(guint). Actually, in case of last-sample of basesink, clock-rate is int and in case of stats of payloaders, clock-rate is uint.
Created attachment 302434 [details] [review] rtsp-stream: get valid clock-rate from last-sample "clock-rate" in last-sample's caps is integer, not unsigned. To get this value properly, variable needs to be type-casted to int.
Comment on attachment 302434 [details] [review] rtsp-stream: get valid clock-rate from last-sample Oh right, it's int in caps and uint in rtp stats. Consistency ;) commit 4ff22ef6d25ffb989ffa57b1f199afd85572e324 Author: Hyunjun Ko <zzoon.ko@samsung.com> Date: Mon Apr 27 19:35:53 2015 +0900 rtsp-stream: get valid clock-rate from last-sample clock-rate in last-sample's caps is integer, not unsigned. To get this value properly, variable needs to be type-casted to int. https://bugzilla.gnome.org/show_bug.cgi?id=747614