Commit 14ffb1a5 authored by Ilkka Ollakka's avatar Ilkka Ollakka

differentiate mpga (layer 2) and mp3 (layer 3) codecs

Fixes #10318
parent 03fe7c3d
......@@ -374,7 +374,7 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_G723_1, VLC_CODEC_G723_1, "G.723.1" },
{ WAVE_FORMAT_MSG723, VLC_CODEC_G723_1, "Microsoft G.723 [G723.1]" },
{ WAVE_FORMAT_VIVOG723, VLC_CODEC_G723_1, "Vivo G.723.1" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MPGA, "Mpeg Audio" },
{ WAVE_FORMAT_MPEGLAYER3, VLC_CODEC_MP3, "Mpeg Audio Layer 3" },
{ WAVE_FORMAT_MPEG, VLC_CODEC_MPGA, "Mpeg Audio" },
{ WAVE_FORMAT_AMR_NB, VLC_CODEC_AMR_NB, "AMR NB" },
{ WAVE_FORMAT_AMR_WB, VLC_CODEC_AMR_WB, "AMR Wideband" },
......
......@@ -156,6 +156,7 @@ static int OpenFilter( vlc_object_t *p_this )
filter_sys_t *p_sys;
if( p_filter->fmt_in.audio.i_format != VLC_CODEC_MPGA &&
p_filter->fmt_in.audio.i_format != VLC_CODEC_MP3 &&
p_filter->fmt_in.audio.i_format != VLC_FOURCC('m','p','g','3') )
return VLC_EGENERIC;
......
......@@ -220,19 +220,7 @@ int OpenEncoder( vlc_object_t *p_this )
config_ChainParse( p_enc, ENC_CFG_PREFIX, ppsz_enc_options, p_enc->p_cfg );
if( p_enc->fmt_out.i_codec == VLC_CODEC_MP3 )
{
i_cat = AUDIO_ES;
i_codec_id = AV_CODEC_ID_MP3;
psz_namecodec = "MPEG I/II Layer 3";
}
else if( p_enc->fmt_out.i_codec == VLC_CODEC_MP2 )
{
i_cat = AUDIO_ES;
i_codec_id = AV_CODEC_ID_MP2;
psz_namecodec = "MPEG I/II Layer 2";
}
else if( p_enc->fmt_out.i_codec == VLC_CODEC_MP1V )
if( p_enc->fmt_out.i_codec == VLC_CODEC_MP1V )
{
i_cat = VIDEO_ES;
i_codec_id = AV_CODEC_ID_MPEG1VIDEO;
......
......@@ -365,8 +365,9 @@ static const struct
/* AV_CODEC_ID_SOL_DPCM */
/* audio codecs */
{ VLC_CODEC_MPGA, AV_CODEC_ID_MP3, AUDIO_ES }, /* prefer MP3 over MP2 */
{ VLC_CODEC_MP3, AV_CODEC_ID_MP3, AUDIO_ES },
{ VLC_CODEC_MPGA, AV_CODEC_ID_MP2, AUDIO_ES },
{ VLC_CODEC_MP2, AV_CODEC_ID_MP2, AUDIO_ES },
{ VLC_CODEC_MP4A, AV_CODEC_ID_AAC, AUDIO_ES },
{ VLC_CODEC_A52, AV_CODEC_ID_AC3, AUDIO_ES },
{ VLC_CODEC_DTS, AV_CODEC_ID_DTS, AUDIO_ES },
......
......@@ -124,7 +124,8 @@ static int Open( 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_CODEC_MPGA )
if(( p_dec->fmt_in.i_codec != VLC_CODEC_MPGA ) &&
( p_dec->fmt_in.i_codec != VLC_CODEC_MP3 ) )
{
return VLC_EGENERIC;
}
......
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