Commit 8bc3f3ea authored by Antoine Cellerier's avatar Antoine Cellerier

With recent libavformat, only use the evil CODEC_ID_MP2 -> CODEC_ID_MP3 hack...

With recent libavformat, only use the evil CODEC_ID_MP2 -> CODEC_ID_MP3 hack if MP2 isn't accepted by the muxer. (muxers which only accept MP2 but not MP3 should now work ... not that i know any)
parent 7a03d566
...@@ -252,14 +252,19 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -252,14 +252,19 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
} }
codec->bit_rate = p_input->p_fmt->i_bitrate; codec->bit_rate = p_input->p_fmt->i_bitrate;
/* This is a hack */
if( i_codec_id == CODEC_ID_MP2 )
i_codec_id = CODEC_ID_MP3;
#if LIBAVFORMAT_VERSION_INT >= ((51<<16)+(8<<8)+0) #if LIBAVFORMAT_VERSION_INT >= ((51<<16)+(8<<8)+0)
codec->codec_tag = av_codec_get_tag( p_sys->oc->oformat->codec_tag, i_codec_id ); codec->codec_tag = av_codec_get_tag( p_sys->oc->oformat->codec_tag, i_codec_id );
if( !codec->codec_tag && i_codec_id == CODEC_ID_MP2 )
{
i_codec_id = CODEC_ID_MP3;
codec->codec_tag = av_codec_get_tag( p_sys->oc->oformat->codec_tag, i_codec_id );
}
#else #else
# warning "WARNING!!!!!!!" # warning "WARNING!!!!!!!"
# warning "Using libavformat muxing with versions older than 51.8.0 (r7593) might produce broken files. # warning "Using libavformat muxing with versions older than 51.8.0 (r7593) might produce broken files.
/* This is a hack */
if( i_codec_id == CODEC_ID_MP2 )
i_codec_id = CODEC_ID_MP3;
codec->codec_tag = p_input->p_fmt->i_codec; codec->codec_tag = p_input->p_fmt->i_codec;
#endif #endif
codec->codec_id = i_codec_id; codec->codec_id = i_codec_id;
......
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