[vlc-commits] commit: stream_filter/httplive.c: newstream can also be 0 ( first index in vlc_array_t). (Jean-Paul Saman )

git at videolan.org git at videolan.org
Wed Nov 3 15:22:34 CET 2010


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Nov  2 10:11:30 2010 +0100| [1cb8978ecce14c2a975bbb8e0fcb836e148a8d57] | committer: Jean-Paul Saman 

stream_filter/httplive.c: newstream can also be 0 (first index in vlc_array_t).

HTTP Live Streams are number from 0 in vlc_array_t. The condition in Download()
excluded 0 as valid stream. The first element in the array is at index 0, so consider
this to be valid.
(cherry picked from commit 7acbd2448c289cf28a80cfc0dd2ece21860aa6e9)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1cb8978ecce14c2a975bbb8e0fcb836e148a8d57
---

 modules/stream_filter/httplive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 2e0e374..051127c 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -852,7 +852,7 @@ static int Download(stream_t *s, hls_stream_t *hls, segment_t *segment, int *cur
     if (hls->bandwidth != bw)
     {
         int newstream = BandwidthAdaptation(s, hls->id, &bw);
-        if ((newstream > 0) && (newstream != *cur_stream))
+        if ((newstream >= 0) && (newstream != *cur_stream))
         {
             msg_Info(s, "switching to %s bandwidth (%"PRIu64") stream",
                      (hls->bandwidth <= bw) ? "faster" : "lower", bw);



More information about the vlc-commits mailing list