]> git.sesse.net Git - vlc/blobdiff - modules/codec/vorbis.c
* modules/gui/skins/src/*: oops, forgot to add a bunch of files.
[vlc] / modules / codec / vorbis.c
index 86570b93e4703985db00347aa885eee964f1c91d..84e4ea9d18a8168c8bf5a7b9032e1ba443735084 100644 (file)
@@ -2,7 +2,7 @@
  * vorbis.c: vorbis decoder module making use of libvorbis.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vorbis.c,v 1.8 2002/11/28 21:00:48 gbazin Exp $
+ * $Id: vorbis.c,v 1.16 2003/03/30 18:14:36 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -109,7 +109,7 @@ static void Interleave   ( float *, const float **, int, int );
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("Vorbis decoder module") );
+    set_description( _("Vorbis audio decoder") );
 #ifdef MODULE_NAME_IS_tremor
     set_capability( "decoder", 90 );
 #else
@@ -182,7 +182,34 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
         msg_Err( p_dec->p_fifo, "2nd Vorbis header is corrupted" );
         goto error;
     }
-
+    /* parse the vorbis comment. FIXME should be done in demuxer*/
+    {
+        input_thread_t *p_input = (input_thread_t *)p_fifo->p_parent;
+        input_info_category_t *p_cat = input_InfoCategory( p_input,
+                                                           _("Vorbis Comment") );
+        int i = 0;
+        char *psz_name, *psz_value, *psz_comment;
+        while ( i < p_dec->vc.comments )
+        {
+            psz_comment = strdup( p_dec->vc.user_comments[i] );
+            if ( !psz_comment )
+            {
+                msg_Warn( p_dec->p_fifo, "Out of memory" );
+                break;
+            }
+            psz_name = psz_comment;
+            psz_value = strchr( psz_comment, '=' );
+            if( psz_value )
+            {
+                *psz_value = '\0';
+                psz_value++;
+                input_AddInfo( p_cat, psz_name, psz_value );
+            }
+            free( psz_comment );
+            i++;
+        }
+    }
+    
     if( GetOggPacket( p_dec, &oggpacket, &i_pts ) != VLC_SUCCESS )
         goto error;