]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - vss.c
vss: Let the transport specify whether periodic headers are necessary.
[paraslash.git] / vss.c
diff --git a/vss.c b/vss.c
index 3405d5a0600d27f359558be50f2cb1f853a0ab9e..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;
-       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;
 }
@@ -282,11 +286,11 @@ static int initialize_fec_client(struct fec_client *fc, struct vss_task *vsst)
        rs = fc->fcp->slices_per_group - fc->fcp->data_slices_per_group;
        ret = num_slices(vsst->header_len, fc->mps - FEC_HEADER_SIZE, rs);
        if (ret < 0)
-               goto err;
+               return ret;
        hs = ret;
        ret = num_slices(mmd->afd.max_chunk_size, fc->mps - FEC_HEADER_SIZE, rs);
        if (ret < 0)
-               goto err;
+               return ret;
        ds = ret;
        k = hs + ds;
        if (k < fc->fcp->data_slices_per_group)
@@ -308,9 +312,6 @@ static int initialize_fec_client(struct fec_client *fc, struct vss_task *vsst)
        fc->stream_start = *now;
        fc->first_stream_chunk = mmd->current_chunk;
        return 1;
-err:
-       fec_free(fc->parms);
-       return ret;
 }
 
 static void compute_group_size(struct vss_task *vsst, struct fec_group *g,