From 192cad600ce33f25bb4f8d8cf2703b2d3eb3c596 Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Thu, 14 May 2009 21:09:40 +0200 Subject: [PATCH] Added and used VLC_CODEC_MP3 when applicable. I also removed its use where it cannot/should not happen. --- include/vlc_fourcc.h | 4 ++++ modules/codec/shine/shine_mod.c | 2 +- modules/misc/rtsp.c | 1 - modules/mux/mpeg/ts.c | 1 - modules/stream_out/rtp.c | 1 - modules/stream_out/transcode.c | 4 ++-- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h index ed7e959af1..6794e5df6d 100644 --- a/include/vlc_fourcc.h +++ b/include/vlc_fourcc.h @@ -293,8 +293,12 @@ #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. diff --git a/modules/codec/shine/shine_mod.c b/modules/codec/shine/shine_mod.c index ec460c5257..168d21a62b 100644 --- a/modules/codec/shine/shine_mod.c +++ b/modules/codec/shine/shine_mod.c @@ -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; diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c index 9e7f97fb98..f1a0467684 100644 --- a/modules/misc/rtsp.c +++ b/modules/misc/rtsp.c @@ -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; diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c index a9c3bf1df4..82737fc4f3 100644 --- a/modules/mux/mpeg/ts.c +++ b/modules/mux/mpeg/ts.c @@ -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; diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c index 7d38258c8b..909a2949dc 100644 --- a/modules/stream_out/rtp.c +++ b/modules/stream_out/rtp.c @@ -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 */ diff --git a/modules/stream_out/transcode.c b/modules/stream_out/transcode.c index 00467d738f..ce71eb8ef9 100644 --- a/modules/stream_out/transcode.c +++ b/modules/stream_out/transcode.c @@ -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 ); -- 2.39.2