From b15735ae7de59e0d9db43f23388d8ac47a6d2def Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 17 Oct 2010 11:45:57 +0200 Subject: [PATCH] vss: Let the transport specify whether periodic headers are necessary. This adds the new flag need_periodic_header to struct fec_client_parms. It is true for the UDP transport and false for the DCCP transport. vss checks this flag in need_audio_header() and does not send the header periodically if the flag is false. --- command.c | 1 + dccp_send.c | 1 + http_send.c | 1 + send.h | 2 ++ server.c | 1 + udp_send.c | 2 ++ vss.c | 8 ++++++-- 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/command.c b/command.c index 1ca5db3c..664d2573 100644 --- a/command.c +++ b/command.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "para.h" #include "error.h" diff --git a/dccp_send.c b/dccp_send.c index a2ee0270..38e4b7c8 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -145,6 +145,7 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds) dfc->fcp.slices_per_group = conf.dccp_slices_per_group_arg; dfc->fcp.init_fec = dccp_init_fec; dfc->fcp.send_fec = dccp_send_fec; + dfc->fcp.need_periodic_header = false; dfc->fc = vss_add_fec_client(sc, &dfc->fcp); } diff --git a/http_send.c b/http_send.c index e376c464..d5c6397e 100644 --- a/http_send.c +++ b/http_send.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "para.h" #include "error.h" diff --git a/send.h b/send.h index 2201bebf..52f7a10d 100644 --- a/send.h +++ b/send.h @@ -131,6 +131,8 @@ struct fec_client_parms { uint8_t slices_per_group; /** Number of slices minus number of redundant slices. */ uint8_t data_slices_per_group; + /** Whether the header must be sent periodically. */ + bool need_periodic_header; /** * Transport-layer initialisation for FEC support. * diff --git a/server.c b/server.c index 48ef55e8..11397d02 100644 --- a/server.c +++ b/server.c @@ -68,6 +68,7 @@ #include #include #include +#include #include "para.h" #include "error.h" diff --git a/udp_send.c b/udp_send.c index 0343feb6..7d4f1c79 100644 --- a/udp_send.c +++ b/udp_send.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "server.cmdline.h" #include "para.h" @@ -344,6 +345,7 @@ static int udp_com_add(struct sender_command_data *scd) ut->fcp.data_slices_per_group = scd->data_slices_per_group; ut->fcp.init_fec = udp_init_fec; ut->fcp.send_fec = udp_send_fec; + ut->fcp.need_periodic_header = true; sc->private_data = ut; sc->fd = -1; diff --git a/vss.c b/vss.c index 96b2ba9e..8c16c958 100644 --- a/vss.c +++ b/vss.c @@ -227,8 +227,12 @@ static bool need_audio_header(struct fec_client *fc, struct vss_task *vsst) return false; if (vsst->header_len == 0) return false; - if (fc->group.num && tv_diff(&fc->next_header_time, now, NULL) > 0) - return false; + if (fc->group.num > 0) { + if (!fc->fcp->need_periodic_header) + return false; + if (tv_diff(&fc->next_header_time, now, NULL) > 0) + return false; + } tv_add(now, &vsst->header_interval, &fc->next_header_time); return true; } -- 2.30.2