]> git.sesse.net Git - vlc/commitdiff
stream_filter/httplive.c: Append new segment any (HLS Live playback) when gap in...
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Fri, 25 Feb 2011 15:58:03 +0000 (16:58 +0100)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Wed, 2 Mar 2011 22:23:23 +0000 (23:23 +0100)
When a gap in segment sequence numbers is detected append the new one
anyway, since there is nothing that can be done to restore the missing
information. It will result in a playback hickup, but that cannot be
helped. Instead only complain loudly.

modules/stream_filter/httplive.c

index 5da0bf69e266f32915f8f950a3165a9fdbff590f..10370f33bb03b5ba8895aa90e87c3cdcb4befee1 100644 (file)
@@ -962,17 +962,13 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
             segment_t *l = segment_GetSegment(*hls, last);
             if (l == NULL) goto fail_and_unlock;
 
-            if ((l->sequence + 1) == p->sequence)
+            if ((l->sequence + 1) != p->sequence)
             {
-                vlc_array_append((*hls)->segments, p);
-                msg_Info(s, "- segment %d appended", p->sequence);
-            }
-            else /* there is a gap */
-            {
-                msg_Err(s, "gap in sequence numbers found: new=%d expected old=%d",
-                        p->sequence, l->sequence);
-                goto fail_and_unlock;
+                msg_Err(s, "gap in sequence numbers found: new=%d expected %d",
+                        p->sequence, l->sequence+1);
             }
+            vlc_array_append((*hls)->segments, p);
+            msg_Info(s, "- segment %d appended", p->sequence);
         }
         vlc_mutex_unlock(&(*hls)->lock);
     }