]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
vss: Let the transport specify whether periodic headers are necessary.
authorAndre Noll <maan@systemlinux.org>
Sun, 17 Oct 2010 09:45:57 +0000 (11:45 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 27 Nov 2010 08:32:44 +0000 (09:32 +0100)
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
dccp_send.c
http_send.c
send.h
server.c
udp_send.c
vss.c

index 1ca5db3c97aea79477fd935569e989de7052064d..664d25734aa14e877735c891f172600982ad2939 100644 (file)
--- a/command.c
+++ b/command.c
@@ -13,6 +13,7 @@
 #include <dirent.h>
 #include <openssl/rc4.h>
 #include <osl.h>
 #include <dirent.h>
 #include <openssl/rc4.h>
 #include <osl.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "error.h"
 
 #include "para.h"
 #include "error.h"
index a2ee0270733a3d47b2053173b9e74bbdbfb4eeff..38e4b7c822e20a209c278a219e28b3121578a305 100644 (file)
@@ -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.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);
 }
 
        dfc->fc = vss_add_fec_client(sc, &dfc->fcp);
 }
 
index e376c4646cc92554dda73cd906d34f9d2f8e7155..d5c6397e4a52eb096f9ebc13cb364d38b7b47455 100644 (file)
@@ -10,6 +10,7 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include <osl.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <osl.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "error.h"
 
 #include "para.h"
 #include "error.h"
diff --git a/send.h b/send.h
index 2201bebf6c39f5f15e51e89dce389e9a7d1cd559..52f7a10d11f1699c41b2e81cb0d5e5f278459414 100644 (file)
--- 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;
        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.
         *
        /**
         * Transport-layer initialisation for FEC support.
         *
index 48ef55e84e7afdbbf13b4f0cd0383c1c837d60fc..11397d029f8fbff5413ed504ffb758a906eb69b4 100644 (file)
--- a/server.c
+++ b/server.c
@@ -68,6 +68,7 @@
 #include <openssl/rc4.h>
 #include <regex.h>
 #include <osl.h>
 #include <openssl/rc4.h>
 #include <regex.h>
 #include <osl.h>
+#include <stdbool.h>
 
 #include "para.h"
 #include "error.h"
 
 #include "para.h"
 #include "error.h"
index 0343feb633c8d34319c70320e0081c701d18d0fe..7d4f1c79939210cb2acf7d74108b3fe34bcac347 100644 (file)
@@ -14,6 +14,7 @@
 #include <netinet/udp.h>
 #include <net/if.h>
 #include <osl.h>
 #include <netinet/udp.h>
 #include <net/if.h>
 #include <osl.h>
+#include <stdbool.h>
 
 #include "server.cmdline.h"
 #include "para.h"
 
 #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.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;
 
        sc->private_data = ut;
        sc->fd = -1;
diff --git a/vss.c b/vss.c
index 96b2ba9eadcb71f2da13e5ccd6d00c08c328444f..8c16c9582f376750ec17218354790aefda4cb12b 100644 (file)
--- 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;
                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;
 }
        tv_add(now, &vsst->header_interval, &fc->next_header_time);
        return true;
 }