]> git.sesse.net Git - vlc/commitdiff
include/vlc_input.h: This commit should have been part of r21062.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 13 Aug 2007 17:28:24 +0000 (17:28 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 13 Aug 2007 17:28:24 +0000 (17:28 +0000)
include/vlc_input.h

index 6870d521956686ff1a63a317ed08fe89063dd082..9b56dbee332b3c9b131beb6119919fd1304290dd 100644 (file)
@@ -201,38 +201,33 @@ VLC_EXPORT( input_item_t *, input_ItemGetById, (playlist_t *, int ) );
 static inline void vlc_audio_replay_gain_MergeFromMeta( audio_replay_gain_t *p_dst,
                                                         const vlc_meta_t *p_meta )
 {
-    int i;
+    char * psz_value;
+
     if( !p_meta )
         return;
 
-    for( i = 0; i < p_meta->i_extra; i++ )
+    if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_TRACK_GAIN" )) ||
+        (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_RADIO" )) )
     {
-        const char *psz_name = p_meta->ppsz_extra_name[i];
-        const char *psz_value = p_meta->ppsz_extra_value[i];
-
-        if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_GAIN" ) ||
-            !strcasecmp( psz_name, "RG_RADIO" ) )
-        {
-            p_dst->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
-            p_dst->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
-        }
-        else if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_PEAK" ) ||
-                 !strcasecmp( psz_name, "RG_PEAK" ) )
-        {
-            p_dst->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
-            p_dst->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
-        }
-        else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_GAIN" ) ||
-                 !strcasecmp( psz_name, "RG_AUDIOPHILE" ) )
-        {
-            p_dst->pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
-            p_dst->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
-        }
-        else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_PEAK" ) )
-        {
-            p_dst->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
-            p_dst->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
-        }
+        p_dst->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
+        p_dst->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+    }
+    else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_TRACK_PEAK" )) ||
+             (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_PEAK" )) )
+    {
+        p_dst->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = VLC_TRUE;
+        p_dst->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = atof( psz_value );
+    }
+    else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_ALBUM_GAIN" )) ||
+             (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "RG_AUDIOPHILE" )) )
+    {
+        p_dst->pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
+        p_dst->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
+    }
+    else if( (psz_value = (char *)vlc_dictionary_value_for_key( &p_meta->extra_tags, "REPLAYGAIN_ALBUM_PEAK" )) )
+    {
+        p_dst->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = VLC_TRUE;
+        p_dst->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
     }
 }