]> git.sesse.net Git - vlc/commitdiff
Added and used VLC_CODEC_MP3 when applicable.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 14 May 2009 19:09:40 +0000 (21:09 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 15 May 2009 20:05:36 +0000 (22:05 +0200)
I also removed its use where it cannot/should not happen.

include/vlc_fourcc.h
modules/codec/shine/shine_mod.c
modules/misc/rtsp.c
modules/mux/mpeg/ts.c
modules/stream_out/rtp.c
modules/stream_out/transcode.c

index ed7e959af1ef0c065b74ba6be2c9802be24964c4..6794e5df6d670257998a0ea73745081fa23574c1 100644 (file)
 #endif
 
 /* Non official codecs, used to force a profile in an encoder */
+/* MPEG-1 video */
 #define VLC_CODEC_MP1V      VLC_FOURCC('m','p','1','v')
+/* MPEG-2 video */
 #define VLC_CODEC_MP2V      VLC_FOURCC('m','p','2','v')
+/* MPEG-I/II layer 3 audio */
+#define VLC_CODEC_MP3       VLC_FOURCC('m','p','3',' ')
 
 /**
  * It returns the codec associatedto a fourcc within a ES category.
index ec460c52574b069454355cffb33a0ee0bdec8dc6..168d21a62bcf2aad53fe40a913c739897f76cb6d 100644 (file)
@@ -74,7 +74,7 @@ static int OpenEncoder( vlc_object_t *p_this )
     encoder_sys_t *p_sys;
 
     /* FIXME: what about layers 1 and 2 ? shine is an 'MP3' encoder */
-    if( p_enc->fmt_out.i_codec != VLC_FOURCC('m','p','3',' ') ||
+    if( p_enc->fmt_out.i_codec != VLC_CODEC_MP3 ||
         p_enc->fmt_out.audio.i_channels > 2 )
         return VLC_EGENERIC;
 
index 9e7f97fb988631cbc56a9953574a58156418fd52..f1a04676849687e501503c0d9f2dac4402f81cb2 100644 (file)
@@ -542,7 +542,6 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
                 p_es->psz_rtpmap = NULL;
             break;
         case VLC_CODEC_MPGA:
-        case VLC_FOURCC( 'm', 'p', '3', ' ' ):
             p_es->i_payload_type = 14;
             p_es->psz_rtpmap = strdup( "MPA/90000" );
             break;
index a9c3bf1df49fe388f8cc573aeff80d2ebcfaef3b..82737fc4f33d99cf768d1da9532498fb3cf5e471 100644 (file)
@@ -1046,7 +1046,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
             switch( p_input->p_fmt->i_codec )
             {
                 case VLC_CODEC_MPGA:
-                case VLC_FOURCC( 'm', 'p', '3', ' ' ):
                     p_stream->i_stream_type =
                         p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04;
                     p_stream->i_stream_id = 0xc0;
index 7d38258c8b4afe6d4f171a0b24ab280388b3c57c..909a2949dcba5d103e27d0dd80423278471aa8a9 100644 (file)
@@ -1064,7 +1064,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt )
             rtp_set_ptime (id, 20, 1);
             break;
         case VLC_CODEC_MPGA:
-        case VLC_FOURCC( 'm', 'p', '3', ' ' ):
             id->i_payload_type = 14;
             id->psz_enc = "MPA";
             id->i_clock_rate = 90000; /* not 44100 */
index 00467d738f64941fca57435e789c6f063ee6ba0f..ce71eb8ef999ab6d87343b6d001c6ee3c4e78436 100644 (file)
@@ -433,8 +433,8 @@ static int Open( vlc_object_t *p_this )
 
     if( p_sys->i_acodec )
     {
-        if( p_sys->i_acodec == VLC_FOURCC('m','p','3',' ') &&
-            p_sys->i_channels > 2 )
+        if( ( p_sys->i_acodec == VLC_CODEC_MP3 ||
+              p_sys->i_acodec == VLC_CODEC_MPGA ) && p_sys->i_channels > 2 )
         {
             msg_Warn( p_stream, "%d channels invalid for mp3, forcing to 2",
                       p_sys->i_channels );