]> git.sesse.net Git - vlc/blobdiff - modules/demux/flac.c
Shut a warning.
[vlc] / modules / demux / flac.c
index 7ff557cc8b1f029666f863c9a1de56689bb17399..9be5869b68e10b6436374c14eae935c0d8adb282 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_demux.h>
 #include <vlc_meta.h>
@@ -63,6 +67,7 @@ struct demux_sys_t
 
     /* Packetizer */
     decoder_t *p_packetizer;
+
     vlc_meta_t *p_meta;
     audio_replay_gain_t replay_gain;
 
@@ -93,7 +98,6 @@ struct demux_sys_t
 static int Open( vlc_object_t * p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
-    module_t    *p_id3;
     demux_sys_t *p_sys;
     const byte_t *p_peek;
     uint8_t     *p_streaminfo;
@@ -148,53 +152,12 @@ static int Open( vlc_object_t * p_this )
     {
         if( p_sys->p_packetizer->fmt_in.p_extra )
             free( p_sys->p_packetizer->fmt_in.p_extra );
-        vlc_object_destroy( p_sys->p_packetizer );
+        vlc_object_release( p_sys->p_packetizer );
 
         msg_Err( p_demux, "cannot find flac packetizer" );
         return VLC_EGENERIC;
     }
 
-    /* Parse possible id3 header */
-    input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );
-    if( p_input )
-    {
-        if( !( input_GetItem( p_input )->p_meta->i_status & ITEM_PREPARSED ) )
-        {
-            p_demux->p_private = malloc( sizeof( demux_meta_t ) );
-            if( !p_demux->p_private )
-            {
-                vlc_object_release( p_input );
-                return VLC_ENOMEM;
-            }
-            if( ( p_id3 = module_Need( p_demux, "meta reader", NULL, 0 ) ) )
-            {
-                demux_meta_t *p_demux_meta = (demux_meta_t *)p_demux->p_private;
-                vlc_meta_t *p_meta = p_demux_meta->p_meta;
-
-                if( !p_sys->p_meta )
-                {
-                    p_sys->p_meta = p_meta;
-                }
-                else if( p_meta )
-                {
-                    vlc_meta_Merge( p_sys->p_meta, p_meta );
-                    vlc_meta_Delete( p_meta );
-                }
-                p_demux->p_private = NULL;
-                module_Unneed( p_demux, p_id3 );
-                int i;
-                for( i = 0; i < p_demux_meta->i_attachments; i++ )
-                    TAB_APPEND_CAST( (input_attachment_t**),
-                            p_sys->i_attachments, p_sys->attachments,
-                            p_demux_meta->attachments[p_demux_meta->i_attachments] );
-                TAB_CLEAN( p_demux_meta->i_attachments,
-                            p_demux_meta->attachments );
-            }
-            free( p_demux->p_private );
-        }
-        vlc_object_release( p_input );
-    }
-
     if( p_sys->i_cover_idx < p_sys->i_attachments )
     {
         char psz_url[128];
@@ -230,7 +193,7 @@ static void Close( vlc_object_t * p_this )
         free( p_sys->p_packetizer->fmt_in.p_extra );
 
     /* Delete the decoder */
-    vlc_object_destroy( p_sys->p_packetizer );
+    vlc_object_release( p_sys->p_packetizer );
     if( p_sys->p_meta )
         vlc_meta_Delete( p_sys->p_meta );
     free( p_sys );
@@ -384,6 +347,12 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             vlc_meta_Merge( p_meta, p_demux->p_sys->p_meta );
         return VLC_SUCCESS;
     }
+    else if( i_query == DEMUX_HAS_UNSUPPORTED_META )
+    {
+        vlc_bool_t *pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
+        *pb_bool = VLC_TRUE;
+        return VLC_SUCCESS;
+    }
     else if( i_query == DEMUX_GET_LENGTH )
     {
         int64_t *pi64 = (int64_t*)va_arg( args, int64_t * );
@@ -671,7 +640,6 @@ static void ParseComment( demux_t *p_demux, const uint8_t *p_data, int i_data )
         {
             /* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
              * undocumented tags and replay gain ) */
-            audio_replay_gain_t *r = &p_sys->replay_gain;
             char *p = strchr( psz, '=' );
             *p++ = '\0';
             vlc_meta_AddExtra( p_sys->p_meta, psz, p );