rtsp: cleanup the watch reset function
This commit is contained in:
parent
07babdd68a
commit
ad5632586a
@ -3064,24 +3064,28 @@ gst_rtsp_watch_reset (GstRTSPWatch * watch)
|
|||||||
if (watch->writesrc)
|
if (watch->writesrc)
|
||||||
g_source_remove_child_source ((GSource *) watch, watch->writesrc);
|
g_source_remove_child_source ((GSource *) watch, watch->writesrc);
|
||||||
|
|
||||||
watch->readsrc =
|
if (watch->conn->input_stream) {
|
||||||
g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM
|
watch->readsrc =
|
||||||
(watch->conn->input_stream), NULL);
|
g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM
|
||||||
g_source_set_callback (watch->readsrc,
|
(watch->conn->input_stream), NULL);
|
||||||
(GSourceFunc) gst_rtsp_source_dispatch_read, watch, NULL);
|
g_source_set_callback (watch->readsrc,
|
||||||
watch->writesrc =
|
(GSourceFunc) gst_rtsp_source_dispatch_read, watch, NULL);
|
||||||
g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
|
|
||||||
(watch->conn->output_stream), NULL);
|
|
||||||
g_source_set_callback (watch->writesrc,
|
|
||||||
(GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
|
|
||||||
|
|
||||||
if (watch->readsrc) {
|
|
||||||
g_source_add_child_source ((GSource *) watch, watch->readsrc);
|
g_source_add_child_source ((GSource *) watch, watch->readsrc);
|
||||||
g_source_unref (watch->readsrc);
|
g_source_unref (watch->readsrc);
|
||||||
|
} else {
|
||||||
|
watch->readsrc = NULL;
|
||||||
}
|
}
|
||||||
if (watch->writesrc) {
|
|
||||||
|
if (watch->conn->output_stream) {
|
||||||
|
watch->writesrc =
|
||||||
|
g_pollable_output_stream_create_source (G_POLLABLE_OUTPUT_STREAM
|
||||||
|
(watch->conn->output_stream), NULL);
|
||||||
|
g_source_set_callback (watch->writesrc,
|
||||||
|
(GSourceFunc) gst_rtsp_source_dispatch_write, watch, NULL);
|
||||||
g_source_add_child_source ((GSource *) watch, watch->writesrc);
|
g_source_add_child_source ((GSource *) watch, watch->writesrc);
|
||||||
g_source_unref (watch->writesrc);
|
g_source_unref (watch->writesrc);
|
||||||
|
} else {
|
||||||
|
watch->writesrc = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user