[vlc-commits] access/http: update Icy metadata on change (close #9332)

Felix Paul Kühne git at videolan.org
Sun Apr 27 22:28:03 CEST 2014


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Apr 27 17:40:03 2014 +0200| [5080dbf52a06d0ca94b5648f9b8b1226ff94df2c] | committer: Felix Paul Kühne

access/http: update Icy metadata on change (close #9332)

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

 modules/access/http.c |   27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/modules/access/http.c b/modules/access/http.c
index 7fdbb68..78a186c 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -871,9 +871,16 @@ static int ReadICYMeta( access_t *p_access )
             p_sys->psz_icy_title = EnsureUTF8( psz_tmp );
             if( !p_sys->psz_icy_title )
                 free( psz_tmp );
-            //p_access->info.i_update |= INPUT_UPDATE_META; FIXME
 
-            msg_Dbg( p_access, "New Title=%s", p_sys->psz_icy_title );
+            msg_Dbg( p_access, "New Icy-Title=%s", p_sys->psz_icy_title );
+            input_thread_t *p_input = access_GetParentInput( p_access );
+            if( p_input )
+            {
+                input_item_t *p_input_item = input_GetItem( p_access->p_input );
+                if( p_input_item )
+                    input_item_SetMeta( p_input_item, vlc_meta_NowPlaying, p_sys->psz_icy_title );
+                vlc_object_release( p_input );
+            }
         }
     }
     free( psz_meta );
@@ -1453,6 +1460,14 @@ static int Request( access_t *p_access, uint64_t i_tell )
             if( !p_sys->psz_icy_name )
                 free( psz_tmp );
             msg_Dbg( p_access, "Icy-Name: %s", p_sys->psz_icy_name );
+            input_thread_t *p_input = access_GetParentInput( p_access );
+            if ( p_input )
+            {
+                input_item_t *p_input_item = input_GetItem( p_access->p_input );
+                if ( p_input_item )
+                    input_item_SetMeta( p_input_item, vlc_meta_Title, p_sys->psz_icy_name );
+                vlc_object_release( p_input );
+            }
 
             p_sys->b_icecast = true; /* be on the safeside. set it here as well. */
             p_sys->b_reconnect = true;
@@ -1466,6 +1481,14 @@ static int Request( access_t *p_access, uint64_t i_tell )
             if( !p_sys->psz_icy_genre )
                 free( psz_tmp );
             msg_Dbg( p_access, "Icy-Genre: %s", p_sys->psz_icy_genre );
+            input_thread_t *p_input = access_GetParentInput( p_access );
+            if( p_input )
+            {
+                input_item_t *p_input_item = input_GetItem( p_access->p_input );
+                if( p_input_item )
+                    input_item_SetMeta( p_input_item, vlc_meta_Genre, p_sys->psz_icy_genre );
+                vlc_object_release( p_input );
+            }
         }
         else if( !strncasecmp( psz, "Icy-Notice", 10 ) )
         {



More information about the vlc-commits mailing list