summaryrefslogtreecommitdiff
path: root/src/sydra.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sydra.c')
-rw-r--r--src/sydra.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sydra.c b/src/sydra.c
index a7a73f4..ca48724 100644
--- a/src/sydra.c
+++ b/src/sydra.c
@@ -167,9 +167,11 @@ int main_loop(options_t* opt)
{
log_printf(INFO, "entering main loop");
- struct udp_sinks udp = { { NULL, NULL }, { NULL, NULL },
+ struct udp_sinks sinks = { { NULL, NULL }, { NULL, NULL },
{ NULL, NULL }, { NULL, NULL }, opt->timeout_ };
- GstElement *pipeline = create_sender_pipeline(opt, &udp);
+ struct udp_sources sources = { NULL, NULL, NULL, NULL, opt->keepalive_int_ };
+ GstElement *pipeline = opt->mode_ == SENDER ? create_sender_pipeline(opt, &sinks) :
+ create_receiver_pipeline(opt, &sources);
if(!pipeline) {
log_printf(ERROR, "creating pipeline failed");
return -1;
@@ -190,7 +192,8 @@ int main_loop(options_t* opt)
log_printf(INFO, "Set State: Paused");
gst_element_set_state(pipeline, GST_STATE_PAUSED);
- if(!attach_udpsinks(&udp))
+ if((opt->mode_ == SENDER && !attach_udpsinks(&sinks)) ||
+ (opt->mode_ == RECEIVER && !attach_udpsources(&sources)))
return -1;
log_printf(INFO, "Set State: Playing");