summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-22 23:57:43 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-04-22 23:57:43 +0000
commit1442d50c9b52f8a44cf2d7a91bffb412ba743c0a (patch)
tree1ca51bce38ea4bed46a847dbb509d177bcc33dcd /libmpcodecs
parent85fb1d7a1a936092d358c182aa7590c2ca2faea5 (diff)
downloadmpv-1442d50c9b52f8a44cf2d7a91bffb412ba743c0a.tar.bz2
mpv-1442d50c9b52f8a44cf2d7a91bffb412ba743c0a.tar.xz
restore old lavc_find_atag to be used when compiling mplayer without libavformat
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15245 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ae_lavc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libmpcodecs/ae_lavc.c b/libmpcodecs/ae_lavc.c
index 1d03bec916..a5792a2474 100644
--- a/libmpcodecs/ae_lavc.c
+++ b/libmpcodecs/ae_lavc.c
@@ -116,6 +116,30 @@ static int get_frame_size(audio_encoder_t *encoder)
return compressed_frame_size;
}
+static uint32_t lavc_find_atag(char *codec)
+{
+ if(codec == NULL)
+ return 0;
+
+ if(! strcasecmp(codec, "mp2"))
+ return 0x50;
+
+ if(! strcasecmp(codec, "mp3"))
+ return 0x55;
+
+ if(! strcasecmp(codec, "ac3"))
+ return 0x2000;
+
+ if(! strcasecmp(codec, "adpcm_ima_wav"))
+ return 0x11;
+
+ if(! strncasecmp(codec, "bonk", 4))
+ return 0x2048;
+
+ return 0;
+}
+
+
int mpae_init_lavc(audio_encoder_t *encoder)
{
encoder->params.samples_per_frame = encoder->params.sample_rate;
@@ -141,7 +165,11 @@ int mpae_init_lavc(audio_encoder_t *encoder)
}
if(lavc_param_atag == 0)
{
+#ifdef USE_LIBAVFORMAT
lavc_param_atag = codec_get_wav_tag(lavc_acodec->id);
+#else
+ lavc_param_atag = lavc_find_atag(lavc_param_acodec);
+#endif
if(!lavc_param_atag)
{
mp_msg(MSGT_MENCODER, MSGL_FATAL, "Couldn't find wav tag for specified codec, exit\n");