From a935b21a83b5a23095849ea1f819bbbbee312720 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Sun, 27 Jul 2008 16:03:59 +0200 Subject: [PATCH] Fixed icy meta data parsing after http reconnection (close #576 and --- modules/access/http.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/access/http.c b/modules/access/http.c index 15b2be30d8..4d2fd32122 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -184,6 +184,7 @@ struct access_sys_t int64_t i_chunk; int i_icy_meta; + int64_t i_icy_offset; char *psz_icy_name; char *psz_icy_genre; char *psz_icy_title; @@ -276,6 +277,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies ) p_sys->p_tls = NULL; p_sys->p_vs = NULL; p_sys->i_icy_meta = 0; + p_sys->i_icy_offset = 0; p_sys->psz_icy_name = NULL; p_sys->psz_icy_genre = NULL; p_sys->psz_icy_title = NULL; @@ -697,10 +699,10 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len ) } - if( p_sys->i_icy_meta > 0 && p_access->info.i_pos > 0 ) + if( p_sys->i_icy_meta > 0 && p_access->info.i_pos-p_sys->i_icy_offset > 0 ) { int64_t i_next = p_sys->i_icy_meta - - p_access->info.i_pos % p_sys->i_icy_meta; + (p_access->info.i_pos - p_sys->i_icy_offset ) % p_sys->i_icy_meta; if( i_next == p_sys->i_icy_meta ) { @@ -1005,6 +1007,7 @@ static int Connect( access_t *p_access, int64_t i_tell ) p_sys->b_chunked = false; p_sys->i_chunk = 0; p_sys->i_icy_meta = 0; + p_sys->i_icy_offset = i_tell; p_sys->psz_icy_name = NULL; p_sys->psz_icy_genre = NULL; p_sys->psz_icy_title = NULL; -- 2.39.2