]> git.sesse.net Git - vlc/blobdiff - modules/codec/vorbis.c
Qt4: forward and back were using key-pressed where they should be using key-action...
[vlc] / modules / codec / vorbis.c
index f7a90783b943abb28b7d3fe4ca7ee17e11f38f83..62cb4d2595df2548510e2dc8f85ef8ddc0e9f838 100644 (file)
@@ -203,13 +203,14 @@ vlc_module_begin ()
 #endif
 
     add_integer( ENC_CFG_PREFIX "quality", 0, NULL, ENC_QUALITY_TEXT,
-                 ENC_QUALITY_LONGTEXT, false );
+                 ENC_QUALITY_LONGTEXT, false )
+        change_integer_range( 0, 10 )
     add_integer( ENC_CFG_PREFIX "max-bitrate", 0, NULL, ENC_MAXBR_TEXT,
-                 ENC_MAXBR_LONGTEXT, false );
+                 ENC_MAXBR_LONGTEXT, false )
     add_integer( ENC_CFG_PREFIX "min-bitrate", 0, NULL, ENC_MINBR_TEXT,
-                 ENC_MINBR_LONGTEXT, false );
+                 ENC_MINBR_LONGTEXT, false )
     add_bool( ENC_CFG_PREFIX "cbr", 0, NULL, ENC_CBR_TEXT,
-                 ENC_CBR_LONGTEXT, false );
+                 ENC_CBR_LONGTEXT, false )
 #endif
 
 vlc_module_end ()
@@ -228,14 +229,13 @@ static int OpenDecoder( vlc_object_t *p_this )
     decoder_t *p_dec = (decoder_t*)p_this;
     decoder_sys_t *p_sys;
 
-    if( p_dec->fmt_in.i_codec != VLC_FOURCC('v','o','r','b') )
+    if( p_dec->fmt_in.i_codec != VLC_CODEC_VORBIS )
     {
         return VLC_EGENERIC;
     }
 
     /* Allocate the memory needed to store the decoder's structure */
-    if( ( p_dec->p_sys = p_sys =
-          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
+    if( ( p_dec->p_sys = p_sys = malloc( sizeof(*p_sys) ) ) == NULL )
         return VLC_ENOMEM;
 
     /* Misc init */
@@ -251,9 +251,9 @@ static int OpenDecoder( vlc_object_t *p_this )
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
 #ifdef MODULE_NAME_IS_tremor
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','i','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
 #else
-    p_dec->fmt_out.i_codec = VLC_FOURCC('f','l','3','2');
+    p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
 #endif
 
     /* Set callbacks */
@@ -274,7 +274,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
     if( i_ret == VLC_SUCCESS )
     {
         p_dec->p_sys->b_packetizer = true;
-        p_dec->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+        p_dec->fmt_out.i_codec = VLC_CODEC_VORBIS;
     }
 
     return i_ret;
@@ -605,16 +605,9 @@ static block_t *SendPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
  *****************************************************************************/
 static void ParseVorbisComments( decoder_t *p_dec )
 {
-    input_thread_t *p_input = (input_thread_t *)p_dec->p_parent;
     char *psz_name, *psz_value, *psz_comment;
-    input_item_t *p_item;
     int i = 0;
 
-    if( p_input->i_object_type != VLC_OBJECT_INPUT )
-        return;
-
-    p_item = input_GetItem( p_input );
-
     while( i < p_dec->p_sys->vc.comments )
     {
         psz_comment = strdup( p_dec->p_sys->vc.user_comments[i] );
@@ -626,33 +619,12 @@ static void ParseVorbisComments( decoder_t *p_dec )
         {
             *psz_value = '\0';
             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( psz_value && ( *psz_value != '\0' ) )
-            {
-                if( !strcasecmp( psz_name, "artist" ) )
-                    input_item_SetArtist( p_item, psz_value );
-                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" ) )
-                {
-                    input_item_SetAlbum( p_item, psz_value );
-                }
-                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" ) )
-                    vlc_meta_SetArtistID( p_item, psz_value );
-                else if( !strcasecmp( psz_name, "musicbrainz_albumid" ) )
-                    input_item_SetAlbumID( p_item, psz_value );
-#endif
-            }
-#endif
+
+            if( !p_dec->p_description )
+                p_dec->p_description = vlc_meta_New();
+            if( p_dec->p_description )
+                vlc_meta_AddExtra( p_dec->p_description, psz_name, psz_value );
+
             if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_GAIN" ) ||
                      !strcasecmp( psz_name, "RG_RADIO" ) )
             {
@@ -822,7 +794,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     vlc_value_t val;
     uint8_t *p_extra;
 
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('v','o','r','b') &&
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_VORBIS &&
         !p_enc->b_force )
     {
         return VLC_EGENERIC;
@@ -834,8 +806,8 @@ static int OpenEncoder( vlc_object_t *p_this )
     p_enc->p_sys = p_sys;
 
     p_enc->pf_encode_audio = Encode;
-    p_enc->fmt_in.i_codec = VLC_FOURCC('f','l','3','2');
-    p_enc->fmt_out.i_codec = VLC_FOURCC('v','o','r','b');
+    p_enc->fmt_in.i_codec = VLC_CODEC_FL32;
+    p_enc->fmt_out.i_codec = VLC_CODEC_VORBIS;
 
     config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );