]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
SAT>IP: fix the bug in satip_rtsp_play() - split add/del requests
authorJaroslav Kysela <perex@perex.cz>
Thu, 10 Jul 2014 12:35:38 +0000 (14:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 10 Jul 2014 12:35:38 +0000 (14:35 +0200)
src/input/mpegts/satip/satip_rtsp.c

index ad3aa1cdad4b18f14693695d5aa25fe53a614a4c..cf6ed2a223fee3a7166e96e1687dde7779d87d49 100644 (file)
@@ -266,7 +266,7 @@ satip_rtsp_play( http_client_t *hc, const char *pids,
     if (addpids) {
       if (delpids) {
         /* try to maintain the maximum request size - simple split */
-        if (strlen(addpids) + strlen(delpids) <= max_pids_len)
+        if (strlen(addpids) + strlen(delpids) >= max_pids_len)
           split = 1;
         else
           htsbuf_append(&q, "&", 1);
@@ -281,5 +281,12 @@ satip_rtsp_play( http_client_t *hc, const char *pids,
   query = htsbuf_to_string(&q);
   r = rtsp_play(hc, stream, query);
   free(query);
+  if (r >= 0 && split) {
+    htsbuf_queue_init(&q, 0);
+    htsbuf_qprintf(&q, "addpids=%s", addpids);
+    query = htsbuf_to_string(&q);
+    r = rtsp_play(hc, stream, query);
+    free(query);
+  }
   return r;
 }