sdp/media: caps_from_media() don't modify the input media
authorMatthew Waters <matthew@centricular.com>
Mon, 3 Apr 2017 06:41:49 +0000 (16:41 +1000)
committerMatthew Waters <matthew@centricular.com>
Mon, 3 Apr 2017 06:49:12 +0000 (16:49 +1000)
commit0dcab96d88376e31459aaeb601cc04a45a3d8966
treef2b3fbbc75ba1efe0bc3e38a81d7defdf0fa2fea
parent9d3622e1bdcf631187de38aa5ff9b8aa6a0605ba
sdp/media: caps_from_media() don't modify the input media

Performing a gst_sdp_media_get_caps_from_media() would result in
changing fields in the GstSDPMedia violating the const tag in the
function declaration.

Before there would be a line with a=rtpmap:96 VP8/90000
after, that attribute would only contain a=rtpmap:96

Fix by performing modifications on duplicated strings instead of on
the internal values.

Also add a simple test for checking that the representation doesn't
change by a gst_sdp_media_get_caps_from_media()
gst-libs/gst/sdp/gstsdpmessage.c
tests/check/libs/sdp.c