]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
satip client: ignore RTP packets with zero length (minisatip 0.7)
authorJaroslav Kysela <perex@perex.cz>
Fri, 28 Apr 2017 13:33:47 +0000 (15:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 28 Apr 2017 13:33:47 +0000 (15:33 +0200)
src/input/mpegts/satip/satip_frontend.c

index a56a0336a7216f1ea86c49dea7e3a72029e9c2f3..f2cf2181877a2598e5b41b77efd7468471e90256 100644 (file)
@@ -1274,7 +1274,7 @@ satip_frontend_rtp_data_received( http_client_t *hc, void *buf, size_t len )
       pos += (((p[pos+2] << 8) | p[pos+3]) + 1) * 4;
     }
     r = c - pos;
-    if (c <= pos || (r % 188) != 0)
+    if (c < pos || (r % 188) != 0)
       return 0;
     /* Use uncorrectable value to notify RTP delivery issues */
     nseq = (p[2] << 8) | p[3];
@@ -1286,6 +1286,8 @@ satip_frontend_rtp_data_received( http_client_t *hc, void *buf, size_t len )
       tvhtrace(LS_SATIP, "TCP/RTP discontinuity (%i != %i)", lfe->sf_seq + 1, nseq);
     }
     lfe->sf_seq = nseq;
+    if (r == 0)
+      return 0;
 
     /* Process */
     if (lfe->sf_skip_ts > 0) {
@@ -1856,7 +1858,7 @@ new_tune:
         pos += (((p[pos+2] << 8) | p[pos+3]) + 1) * 4;
       }
       r = c - pos;
-      if (c <= pos || (r % 188) != 0)
+      if (c < pos || (r % 188) != 0)
         continue;
       /* Use uncorrectable value to notify RTP delivery issues */
       nseq = (p[2] << 8) | p[3];
@@ -1867,6 +1869,8 @@ new_tune:
         tvhtrace(LS_SATIP, "RTP discontinuity (%i != %i)", seq + 1, nseq);
       }
       seq = nseq;
+      if (r == 0)
+        continue;
       /* Process */
       if (lfe->sf_skip_ts > 0) {
         if (lfe->sf_skip_ts < r) {