summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2015-08-31 21:05:03 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2015-10-02 17:39:10 -0400
commit43c213fc5db75dcf570ef1c224122307a0899911 (patch)
tree99960a987a2bc795f6697d31e298892f91c41a24 /gst
parentd5e26ab9099e5a46eda7e9b59f01c1efe463344d (diff)
downloadgstreamer-plugins-good-43c213fc5db75dcf570ef1c224122307a0899911.tar.gz
rtpmux: As 0xFFFFFFFF is a valid ssrc, check if it has been set
https://bugzilla.gnome.org/show_bug.cgi?id=752694
Diffstat (limited to 'gst')
-rw-r--r--gst/rtpmanager/gstrtpmux.c8
-rw-r--r--gst/rtpmanager/gstrtpmux.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/gst/rtpmanager/gstrtpmux.c b/gst/rtpmanager/gstrtpmux.c
index 5c9c7160e..4711acbc9 100644
--- a/gst/rtpmanager/gstrtpmux.c
+++ b/gst/rtpmanager/gstrtpmux.c
@@ -156,7 +156,7 @@ gst_rtp_mux_class_init (GstRTPMuxClass * klass)
0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_SSRC,
g_param_spec_uint ("ssrc", "SSRC",
- "The SSRC of the packets (-1 == random)",
+ "The SSRC of the packets (default == random)",
0, G_MAXUINT, DEFAULT_SSRC,
GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
@@ -296,6 +296,7 @@ gst_rtp_mux_init (GstRTPMux * rtp_mux)
rtp_mux->ssrc = DEFAULT_SSRC;
rtp_mux->current_ssrc = DEFAULT_SSRC;
+ rtp_mux->ssrc_random = TRUE;
rtp_mux->ts_offset = DEFAULT_TIMESTAMP_OFFSET;
rtp_mux->seqnum_offset = DEFAULT_SEQNUM_OFFSET;
@@ -649,7 +650,7 @@ gst_rtp_mux_setcaps (GstPad * pad, GstRTPMux * rtp_mux, GstCaps * caps)
/* if we don't have a specified ssrc, first try to take one from the caps,
and if that fails, generate one */
if (!rtp_mux->have_ssrc) {
- if (rtp_mux->ssrc == DEFAULT_SSRC) {
+ if (rtp_mux->ssrc_random) {
if (!gst_structure_get_uint (structure, "ssrc", &rtp_mux->current_ssrc))
rtp_mux->current_ssrc = g_random_int ();
rtp_mux->have_ssrc = TRUE;
@@ -865,6 +866,7 @@ gst_rtp_mux_set_property (GObject * object,
rtp_mux->ssrc = g_value_get_uint (value);
rtp_mux->current_ssrc = rtp_mux->ssrc;
rtp_mux->have_ssrc = TRUE;
+ rtp_mux->ssrc_random = FALSE;
GST_OBJECT_UNLOCK (rtp_mux);
break;
default:
@@ -950,7 +952,7 @@ gst_rtp_mux_ready_to_paused (GstRTPMux * rtp_mux)
rtp_mux->last_stop = GST_CLOCK_TIME_NONE;
- if (rtp_mux->ssrc == DEFAULT_SSRC) {
+ if (rtp_mux->ssrc_random) {
rtp_mux->have_ssrc = FALSE;
} else {
rtp_mux->current_ssrc = rtp_mux->ssrc;
diff --git a/gst/rtpmanager/gstrtpmux.h b/gst/rtpmanager/gstrtpmux.h
index b94d408ba..3de9f4186 100644
--- a/gst/rtpmanager/gstrtpmux.h
+++ b/gst/rtpmanager/gstrtpmux.h
@@ -72,6 +72,7 @@ struct _GstRTPMux
guint ssrc;
guint current_ssrc;
gboolean have_ssrc;
+ gboolean ssrc_random;
GstPad *last_pad; /* protected by object lock */