vlc | branch: master | Jean-Paul Saman <jean-paul.sa...@m2x.nl> | Tue Dec 28 
15:06:04 2010 +0100| [30296dcacd8934c05e5542d3218c03693fe8eaa9] | committer: 
Jean-Paul Saman 

stream_filter/httplive.c: b_cache determined in wrong place

The logic to determine if caching of segments is allowed or denied was flawed. 
It
only determined it onces after the playlists were loaded. In case of a meta 
playlist
the logic would only indicated the caching value for the last added HLS stream.

The fix is to determine p_sys->b_caching (caching segments allowed or not) when 
switching
segments or HLS streams (adaptive bandwidth).

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

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

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 047094a..91070ee 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -815,10 +815,6 @@ static int parse_HTTPLiveStreaming(stream_t *s)
             /* Stream size (approximate) */
             hls->size = hls_GetStreamSize(hls);
         }
-
-        /* Can we cache files after playback */
-        p_sys->b_cache = hls->b_cache;
-
         vlc_mutex_unlock(&hls->lock);
     }
 
@@ -1394,6 +1390,7 @@ static segment_t *GetSegment(stream_t *s)
             /* This segment is ready? */
             if (segment->data != NULL)
             {
+                p_sys->b_cache = hls->b_cache;
                 vlc_mutex_unlock(&hls->lock);
                 return segment;
             }
@@ -1428,6 +1425,7 @@ static segment_t *GetSegment(stream_t *s)
             (p_sys->playback.segment < i_segment))
         {
             p_sys->playback.current = i_stream;
+            p_sys->b_cache = hls->b_cache;
             vlc_mutex_unlock(&hls->lock);
             return segment;
         }

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to