/* This is a hack */
if( 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 );//p_input->p_fmt->i_codec;
+#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 );
+#else
+# warning "WARNING!!!!!!!"
+# warning "Using libavformat muxing with versions older than 51.8.0 (r7593) might produce borken files.
+ codec->codec_tag = p_input->p_fmt->i_codec;
+#endif
codec->codec_id = i_codec_id;
if( p_input->p_fmt->i_extra )