summaryrefslogtreecommitdiff
path: root/src/mov_encoder_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mov_encoder_writer.cc')
-rw-r--r--src/mov_encoder_writer.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mov_encoder_writer.cc b/src/mov_encoder_writer.cc
index 572a81e..7f3bfec 100644
--- a/src/mov_encoder_writer.cc
+++ b/src/mov_encoder_writer.cc
@@ -81,7 +81,15 @@ MovEncoderWriter::MovEncoderWriter(const char* cpr,
file = new File(fname, "mpg", info);
- multicast = new Multicast(info);
+ if(config->readBool("server_multicast")) {
+ string *addr = config->readString("server_multicast_addr");
+ int port = config->readInt("server_multicast_port");
+ info->info("Enabling multicast %s : %d", addr->c_str(), port);
+ multicast = new Multicast(info, (char*)addr->c_str(), port);
+ } else {
+ info->info("Disabling multicast");
+ multicast = NULL;
+ }
video_queue = video_q;
audio_queue = audio_q;
@@ -93,7 +101,7 @@ MovEncoderWriter::~MovEncoderWriter()
{
info->info("~MovEncoderWriter");
delete file;
- delete multicast;
+ if(multicast) delete multicast;
}