From ba4676809dfe6b305332ed1be15dd80b507438c0 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 2 Nov 2017 10:55:50 -0400 Subject: [PATCH] small fixes and improvements for packet forwarding feature #411 Change-Id: Ibf7aba46b38900d405824ab79005de65cd0be7d9 --- recording-daemon/forward.c | 7 ++++++- recording-daemon/metafile.c | 8 +++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/recording-daemon/forward.c b/recording-daemon/forward.c index 793052365..45cec2309 100644 --- a/recording-daemon/forward.c +++ b/recording-daemon/forward.c @@ -1,7 +1,8 @@ +#include "forward.h" +#include #include #include #include -#include "forward.h" #include "main.h" #include "log.h" @@ -14,7 +15,11 @@ void start_forwarding_capture(metafile_t *mf, char *meta_info) { return; } +#ifdef SOCK_SEQPACKET if ((sock = socket(AF_UNIX, SOCK_SEQPACKET, 0)) == -1) { +#else + if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1) { +#endif ilog(LOG_ERR, "Error creating socket: %s", strerror(errno)); return; } diff --git a/recording-daemon/metafile.c b/recording-daemon/metafile.c index 0c339d6e2..64ce12fd3 100644 --- a/recording-daemon/metafile.c +++ b/recording-daemon/metafile.c @@ -25,10 +25,8 @@ static void meta_free(void *ptr) { metafile_t *mf = ptr; dbg("freeing metafile info for %s", mf->name); - if (output_enabled) { - output_close(mf->mix_out); - mix_destroy(mf->mix); - } + output_close(mf->mix_out); + mix_destroy(mf->mix); g_string_chunk_free(mf->gsc); for (int i = 0; i < mf->streams->len; i++) { stream_t *stream = g_ptr_array_index(mf->streams, i); @@ -36,7 +34,7 @@ static void meta_free(void *ptr) { stream_free(stream); } g_ptr_array_free(mf->streams, TRUE); - if (output_enabled) + if (mf->ssrc_hash) g_hash_table_destroy(mf->ssrc_hash); g_slice_free1(sizeof(*mf), mf); }