]> git.sesse.net Git - vlc/blobdiff - modules/codec/vorbis.c
s/pl_Yield/pl_Hold/
[vlc] / modules / codec / vorbis.c
index a9a7784417a8934d460e37744e9b88869ee78194..952b33f97adfcab76a0d8336e029cc8ecfe2b2d8 100644 (file)
@@ -31,7 +31,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 #include <vlc_aout.h>
@@ -95,7 +95,7 @@ struct decoder_sys_t
     int pi_chan_table[AOUT_CHAN_MAX];
 };
 
-static int pi_channels_maps[9] =
+static const int pi_channels_maps[9] =
 {
     0,
     AOUT_CHAN_CENTER,
@@ -132,11 +132,6 @@ static const uint32_t pi_4channels_in[] =
 static const uint32_t pi_3channels_in[] =
 { AOUT_CHAN_LEFT, AOUT_CHAN_CENTER, AOUT_CHAN_RIGHT, 0 };
 
-/* our internal channel order (WG-4 order) */
-static const uint32_t pi_channels_out[] =
-{ AOUT_CHAN_LEFT, AOUT_CHAN_RIGHT, AOUT_CHAN_REARLEFT, AOUT_CHAN_REARRIGHT,
-  AOUT_CHAN_CENTER, AOUT_CHAN_LFE, 0 };
-
 /****************************************************************************
  * Local prototypes
  ****************************************************************************/
@@ -633,10 +628,7 @@ static void ParseVorbisComments( decoder_t *p_dec )
     {
         psz_comment = strdup( p_dec->p_sys->vc.user_comments[i] );
         if( !psz_comment )
-        {
-            msg_Warn( p_dec, "out of memory" );
             break;
-        }
         psz_name = psz_comment;
         psz_value = strchr( psz_comment, '=' );
         if( psz_value )
@@ -645,52 +637,30 @@ static void ParseVorbisComments( decoder_t *p_dec )
             psz_value++;
             input_Control( p_input, INPUT_ADD_INFO, _("Vorbis comment"),
                            psz_name, "%s", psz_value );
+/*TODO: dot he test at the beginning and save time !! */
 #ifndef HAVE_TAGLIB
-            if( !strcasecmp( psz_name, "artist" ) )
+            if( psz_value && ( *psz_value != '\0' ) )
             {
-                if( psz_value && ( *psz_value != '\0' ) )
-                {
+                if( !strcasecmp( psz_name, "artist" ) )
                     input_item_SetArtist( p_item, psz_value );
-                }
-            }
-            else if( !strcasecmp( psz_name, "title" ) )
-            {
-                if( psz_value && ( *psz_value != '\0' ) )
+                else if( !strcasecmp( psz_name, "title" ) )
                 {
                     input_item_SetTitle( p_item, psz_value );
                     p_item->psz_name = strdup( psz_value );
                 }
-            }
-            else if( !strcasecmp( psz_name, "album" ) )
-            {
-                if( psz_value && ( *psz_value != '\0' ) )
+                else if( !strcasecmp( psz_name, "album" ) )
                 {
                     input_item_SetAlbum( p_item, psz_value );
                 }
-            }
-            else if( !strcasecmp( psz_name, "musicbrainz_trackid" ) )
-            {
-                if( psz_value && ( *psz_value != '\0' ) )
-                {
+                else if( !strcasecmp( psz_name, "musicbrainz_trackid" ) )
                     input_item_SetTrackID( p_item, psz_value );
-                }
-            }
 #if 0 //not used
-            else if( !strcasecmp( psz_name, "musicbrainz_artistid" ) )
-            {
-                if( psz_value && ( *psz_value != '\0' ) )
-                {
+                else if( !strcasecmp( psz_name, "musicbrainz_artistid" ) )
                     vlc_meta_SetArtistID( p_item, psz_value );
-                }
-            }
-            else if( !strcasecmp( psz_name, "musicbrainz_albumid" ) )
-            {
-                if( psz_value && ( *psz_value != '\0' ) )
-                {
+                else if( !strcasecmp( psz_name, "musicbrainz_albumid" ) )
                     input_item_SetAlbumID( p_item, psz_value );
-                }
-            }
 #endif
+            }
 #endif
             if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_GAIN" ) ||
                      !strcasecmp( psz_name, "RG_RADIO" ) )
@@ -724,7 +694,7 @@ static void ParseVorbisComments( decoder_t *p_dec )
                 r->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
             }
         }
-        var_SetInteger( pl_Yield( p_input ), "item-change", p_item->i_id );
+        var_SetInteger( pl_Hold( p_input ), "item-change", p_item->i_id );
         pl_Release( p_input );
         free( psz_comment );
         i++;
@@ -761,12 +731,12 @@ static void ConfigureChannelOrder(int *pi_chan_table, int i_channels, uint32_t i
     }
 
     if( b_decode )
-        aout_CheckChannelReorder( pi_channels_in, pi_channels_out,
+        aout_CheckChannelReorder( pi_channels_in, NULL,
                                   i_channel_mask & AOUT_CHAN_PHYSMASK,
                                   i_channels,
                                   pi_chan_table );
     else
-        aout_CheckChannelReorder( pi_channels_out, pi_channels_in,
+        aout_CheckChannelReorder( NULL, pi_channels_in,
                                   i_channel_mask & AOUT_CHAN_PHYSMASK,
                                   i_channels,
                                   pi_chan_table );