After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747614 - gst-rtsp-server: uninitialized clock rate causes critical warning
gst-rtsp-server: uninitialized clock rate causes critical warning
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other All
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-10 11:27 UTC by Hyunjun Ko
Modified: 2015-04-27 10:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-stream-transport: Initialize clock rate before getting rtp info (982 bytes, patch)
2015-04-10 11:28 UTC, Hyunjun Ko
rejected Details | Review
rtsp-stream: get valid clock-rate from last-sample (1.07 KB, patch)
2015-04-27 10:39 UTC, Hyunjun Ko
committed Details | Review

Description Hyunjun Ko 2015-04-10 11:27:16 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.
Comment 1 Hyunjun Ko 2015-04-10 11:28:39 UTC
Created attachment 301275 [details] [review]
rtsp-stream-transport: Initialize clock rate before getting rtp info
Comment 2 Sebastian Dröge (slomo) 2015-04-26 19:01:52 UTC
How can this be reproduced? We should really never do anything with an invalid clock rate, and should actually get one here
Comment 3 Sebastian Dröge (slomo) 2015-04-26 19:02:17 UTC
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.
Comment 4 Hyunjun Ko 2015-04-27 10:32:21 UTC
(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.
Comment 5 Hyunjun Ko 2015-04-27 10:39:01 UTC
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 6 Sebastian Dröge (slomo) 2015-04-27 10:42:28 UTC
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