mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-02 16:52:42 +00:00
rtsp-client: changed session media iteration
In client_unlink_session: now don't iterate in session->medias list where items are removed by gst_rtsp_session_release_media. Instead, repeatedly remove the first item.
This commit is contained in:
parent
dc796bf075
commit
8f5d82be6d
1 changed files with 3 additions and 5 deletions
|
@ -114,15 +114,13 @@ gst_rtsp_client_init (GstRTSPClient * client)
|
||||||
static void
|
static void
|
||||||
client_unlink_session (GstRTSPClient * client, GstRTSPSession * session)
|
client_unlink_session (GstRTSPClient * client, GstRTSPSession * session)
|
||||||
{
|
{
|
||||||
GList *medias;
|
|
||||||
|
|
||||||
/* unlink all media managed in this session */
|
/* unlink all media managed in this session */
|
||||||
for (medias = session->medias; medias; medias = g_list_next (medias)) {
|
while (g_list_length (session->medias) > 0) {
|
||||||
GstRTSPSessionMedia *media = medias->data;
|
GstRTSPSessionMedia *media = g_list_first (session->medias)->data;
|
||||||
|
|
||||||
gst_rtsp_session_media_set_state (media, GST_STATE_NULL);
|
gst_rtsp_session_media_set_state (media, GST_STATE_NULL);
|
||||||
unlink_session_streams (client, session, media);
|
unlink_session_streams (client, session, media);
|
||||||
/* unmanage the media in the session. */
|
/* unmanage the media in the session. this will modify session->medias */
|
||||||
gst_rtsp_session_release_media (session, media);
|
gst_rtsp_session_release_media (session, media);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue