Commit 192cad60 authored by Laurent Aimar's avatar Laurent Aimar

Added and used VLC_CODEC_MP3 when applicable.

I also removed its use where it cannot/should not happen.
parent ec6a7b8e
...@@ -293,8 +293,12 @@ ...@@ -293,8 +293,12 @@
#endif #endif
/* Non official codecs, used to force a profile in an encoder */ /* Non official codecs, used to force a profile in an encoder */
/* MPEG-1 video */
#define VLC_CODEC_MP1V VLC_FOURCC('m','p','1','v') #define VLC_CODEC_MP1V VLC_FOURCC('m','p','1','v')
/* MPEG-2 video */
#define VLC_CODEC_MP2V VLC_FOURCC('m','p','2','v') #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. * It returns the codec associatedto a fourcc within a ES category.
......
...@@ -74,7 +74,7 @@ static int OpenEncoder( vlc_object_t *p_this ) ...@@ -74,7 +74,7 @@ static int OpenEncoder( vlc_object_t *p_this )
encoder_sys_t *p_sys; encoder_sys_t *p_sys;
/* FIXME: what about layers 1 and 2 ? shine is an 'MP3' encoder */ /* 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 ) p_enc->fmt_out.audio.i_channels > 2 )
return VLC_EGENERIC; return VLC_EGENERIC;
......
...@@ -542,7 +542,6 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt ) ...@@ -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; p_es->psz_rtpmap = NULL;
break; break;
case VLC_CODEC_MPGA: case VLC_CODEC_MPGA:
case VLC_FOURCC( 'm', 'p', '3', ' ' ):
p_es->i_payload_type = 14; p_es->i_payload_type = 14;
p_es->psz_rtpmap = strdup( "MPA/90000" ); p_es->psz_rtpmap = strdup( "MPA/90000" );
break; break;
......
...@@ -1046,7 +1046,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -1046,7 +1046,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
switch( p_input->p_fmt->i_codec ) switch( p_input->p_fmt->i_codec )
{ {
case VLC_CODEC_MPGA: case VLC_CODEC_MPGA:
case VLC_FOURCC( 'm', 'p', '3', ' ' ):
p_stream->i_stream_type = p_stream->i_stream_type =
p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04; p_input->p_fmt->audio.i_rate >= 32000 ? 0x03 : 0x04;
p_stream->i_stream_id = 0xc0; p_stream->i_stream_id = 0xc0;
......
...@@ -1064,7 +1064,6 @@ static sout_stream_id_t *Add( sout_stream_t *p_stream, es_format_t *p_fmt ) ...@@ -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); rtp_set_ptime (id, 20, 1);
break; break;
case VLC_CODEC_MPGA: case VLC_CODEC_MPGA:
case VLC_FOURCC( 'm', 'p', '3', ' ' ):
id->i_payload_type = 14; id->i_payload_type = 14;
id->psz_enc = "MPA"; id->psz_enc = "MPA";
id->i_clock_rate = 90000; /* not 44100 */ id->i_clock_rate = 90000; /* not 44100 */
......
...@@ -433,8 +433,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -433,8 +433,8 @@ static int Open( vlc_object_t *p_this )
if( p_sys->i_acodec ) if( p_sys->i_acodec )
{ {
if( p_sys->i_acodec == VLC_FOURCC('m','p','3',' ') && if( ( p_sys->i_acodec == VLC_CODEC_MP3 ||
p_sys->i_channels > 2 ) p_sys->i_acodec == VLC_CODEC_MPGA ) && p_sys->i_channels > 2 )
{ {
msg_Warn( p_stream, "%d channels invalid for mp3, forcing to 2", msg_Warn( p_stream, "%d channels invalid for mp3, forcing to 2",
p_sys->i_channels ); p_sys->i_channels );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment