summaryrefslogtreecommitdiff
path: root/src/sydra.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-09-27 18:35:34 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-09-27 18:35:34 +0200
commit15b4ff94088747cb6a29f05a48d2dd55f51acb81 (patch)
treeb34e39caba27da9d6a19a26d5c4a2a86cfcef716 /src/sydra.c
parentadded option for mode (diff)
prepared main loop for receiver 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");