changeset 21771:4f317822d1fc

first step toward amr-nb muxing support
author michael
date Fri, 29 Dec 2006 18:56:28 +0000
parents 7b549b0ee467
children 8bc0464ab286
files libmpcodecs/ae_lavc.c libmpdemux/demux_lavf.c libmpdemux/muxer_lavf.c
diffstat 3 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ae_lavc.c	Fri Dec 29 18:35:22 2006 +0000
+++ b/libmpcodecs/ae_lavc.c	Fri Dec 29 18:56:28 2006 +0000
@@ -30,6 +30,7 @@
 static int compressed_frame_size = 0;
 #if defined(USE_LIBAVFORMAT) ||  defined(USE_LIBAVFORMAT_SO)
 extern unsigned int codec_get_wav_tag(int id);
+extern const int mp_wav_tags[];
 #endif
 
 static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a)
@@ -173,6 +174,8 @@
 	{
 #if defined(USE_LIBAVFORMAT) ||  defined(USE_LIBAVFORMAT_SO)
 		lavc_param_atag = codec_get_wav_tag(lavc_acodec->id);
+                if(!lavc_param_atag)
+                        lavc_param_atag =  codec_get_tag(mp_wav_tags, lavc_acodec->id);
 #else
 		lavc_param_atag = lavc_find_atag(lavc_param_acodec);
 #endif
--- a/libmpdemux/demux_lavf.c	Fri Dec 29 18:35:22 2006 +0000
+++ b/libmpdemux/demux_lavf.c	Fri Dec 29 18:56:28 2006 +0000
@@ -87,6 +87,7 @@
     { CODEC_ID_WAVPACK,           MKTAG('W', 'V', 'P', 'K')},
     { CODEC_ID_WESTWOOD_SND1,     MKTAG('S', 'N', 'D', '1')},
     { CODEC_ID_XAN_DPCM,          MKTAG('A', 'x', 'a', 'n')},
+    { CODEC_ID_AMR_NB,            MKTAG('n', 'b',   0,   0)},
     { 0, 0 },
 };
 
--- a/libmpdemux/muxer_lavf.c	Fri Dec 29 18:35:22 2006 +0000
+++ b/libmpdemux/muxer_lavf.c	Fri Dec 29 18:56:28 2006 +0000
@@ -26,6 +26,7 @@
 extern unsigned int codec_get_wav_tag(int id);
 extern enum CodecID codec_get_bmp_id(unsigned int tag);
 extern enum CodecID codec_get_wav_id(unsigned int tag);
+extern const int mp_wav_tags[];
 
 extern char *info_name;
 extern char *info_artist;
@@ -209,6 +210,8 @@
 	if(stream->type == MUXER_TYPE_AUDIO)
 	{
 		ctx->codec_id = codec_get_wav_id(stream->wf->wFormatTag); 
+                if(!ctx->codec_id)
+                        ctx->codec_id = codec_get_id(mp_wav_tags, stream->wf->wFormatTag);
 #if 0 //breaks aac in mov at least
 		ctx->codec_tag = codec_get_wav_tag(ctx->codec_id);
 #endif