aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-07 17:37:23 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-07 17:37:23 +0000
commit8abf4e3f175a3f78902d17e0f57ec2fec0c283a3 (patch)
tree061c615d873c9eecd5d91d34f97dd170094ddc16 /libmpdemux
parent9d3fe04dcebe977b6f379e28317cb23ae4e23dc3 (diff)
Add our own CODEC_ID -> fourcc translation tables so we do not need
to put them into ffmpeg. Also adds support for S24BE and S8 audio formats, which fixes e.g. http://samples.mplayerhq.hu/A-codecs/MACE/Bach1-1.aiff and http://samples.mplayerhq.hu/MXF/ebu_small.mxf . git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20749 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_lavf.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c
index 3711d1da52..1a3b3709e0 100644
--- a/libmpdemux/demux_lavf.c
+++ b/libmpdemux/demux_lavf.c
@@ -33,8 +33,14 @@
#ifdef USE_LIBAVFORMAT_SO
#include <ffmpeg/avformat.h>
#include <ffmpeg/opt.h>
+typedef struct CodecTag {
+ int id;
+ unsigned int tag;
+ unsigned int invalid_asf : 1;
+} CodecTag;
#else
#include "avformat.h"
+#include "riff.h"
#include "avi.h"
#include "opt.h"
#endif
@@ -65,6 +71,18 @@ extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
int64_t ff_gcd(int64_t a, int64_t b);
+const CodecTag mp_wav_tags[] = {
+ { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')},
+ { CODEC_ID_PCM_S24BE, MKTAG('i', 'n', '2', '4')},
+ { CODEC_ID_PCM_S8, MKTAG('t', 'w', 'o', 's')},
+ { 0, 0 },
+};
+
+const CodecTag mp_bmp_tags[] = {
+ { CODEC_ID_XAN_WC3, MKTAG('W', 'C', '3', 'V')},
+ { 0, 0 },
+};
+
static int mp_open(URLContext *h, const char *filename, int flags){
return 0;
}
@@ -213,6 +231,8 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
priv->audio_streams++;
if(!codec->codec_tag)
codec->codec_tag= codec_get_wav_tag(codec->codec_id);
+ if(!codec->codec_tag)
+ codec->codec_tag= codec_get_tag(mp_wav_tags, codec->codec_id);
wf->wFormatTag= codec->codec_tag;
wf->nChannels= codec->channels;
wf->nSamplesPerSec= codec->sample_rate;
@@ -279,6 +299,8 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
priv->video_streams++;
if(!codec->codec_tag)
codec->codec_tag= codec_get_bmp_tag(codec->codec_id);
+ if(!codec->codec_tag)
+ codec->codec_tag= codec_get_tag(mp_bmp_tags, codec->codec_id);
bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size;
bih->biWidth= codec->width;
bih->biHeight= codec->height;