diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-22 05:00:25 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-07-26 06:16:52 +0300 |
commit | 9ce0838ffd01371bd5b62fae38f94ce23d5339bb (patch) | |
tree | 4d787831ce5678ffa061e7c3a4b198744601b649 /libmpdemux | |
parent | cd4e8dc1fa2863dcce62a44dd9ea105f9f9288f4 (diff) | |
download | mpv-9ce0838ffd01371bd5b62fae38f94ce23d5339bb.tar.bz2 mpv-9ce0838ffd01371bd5b62fae38f94ce23d5339bb.tar.xz |
Use own mp_*_taglists code instead of libavformat internals
Use the version of code under ffmpeg_files/ instead of relying on
libavformat source files to be available.
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_lavf.c | 6 | ||||
-rw-r--r-- | libmpdemux/mp_taglists.c | 18 | ||||
-rw-r--r-- | libmpdemux/mp_taglists.h | 10 | ||||
-rw-r--r-- | libmpdemux/muxer_lavf.c | 4 |
4 files changed, 23 insertions, 15 deletions
diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index 310ec83c09..1c25edf160 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -235,7 +235,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { priv->audio_streams++; wf= calloc(sizeof(WAVEFORMATEX) + codec->extradata_size, 1); // For some formats (like PCM) always trust CODEC_ID_* more than codec_tag - override_tag= av_codec_get_tag(mp_wav_override_taglists, codec->codec_id); + override_tag= mp_av_codec_get_tag(mp_wav_override_taglists, codec->codec_id); if (override_tag) codec->codec_tag= override_tag; // mp4a tag is used for all mp4 files no matter what they actually contain @@ -244,7 +244,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { if(codec->codec_id == CODEC_ID_ADPCM_IMA_AMV) codec->codec_tag= MKTAG('A','M','V','A'); if(!codec->codec_tag) - codec->codec_tag= av_codec_get_tag(mp_wav_taglists, codec->codec_id); + codec->codec_tag= mp_av_codec_get_tag(mp_wav_taglists, codec->codec_id); wf->wFormatTag= codec->codec_tag; wf->nChannels= codec->channels; wf->nSamplesPerSec= codec->sample_rate; @@ -322,7 +322,7 @@ static void handle_stream(demuxer_t *demuxer, AVFormatContext *avfc, int i) { } } if(!codec->codec_tag) - codec->codec_tag= av_codec_get_tag(mp_bmp_taglists, codec->codec_id); + codec->codec_tag= mp_av_codec_get_tag(mp_bmp_taglists, codec->codec_id); bih->biSize= sizeof(BITMAPINFOHEADER) + codec->extradata_size; bih->biWidth= codec->width; bih->biHeight= codec->height; diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index 037ada5eb0..e1b6e90454 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -19,9 +19,13 @@ #include "config.h" #include "libavformat/avformat.h" -#include "libavformat/riff.h" +#include <libavcodec/avcodec.h> -static const AVCodecTag mp_wav_tags[] = { +#include "mp_taglists.h" + +#include "ffmpeg_files/taglists.c" + +static const struct mp_AVCodecTag mp_wav_tags[] = { { CODEC_ID_RA_144, MKTAG('1', '4', '_', '4')}, { CODEC_ID_RA_288, MKTAG('2', '8', '_', '8')}, { CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')}, @@ -51,9 +55,9 @@ static const AVCodecTag mp_wav_tags[] = { { 0, 0 }, }; -const struct AVCodecTag *mp_wav_taglists[] = {ff_codec_wav_tags, mp_wav_tags, 0}; +const struct mp_AVCodecTag *mp_wav_taglists[] = {mp_ff_codec_wav_tags, mp_wav_tags, 0}; -static const AVCodecTag mp_wav_override_tags[] = { +static const struct mp_AVCodecTag mp_wav_override_tags[] = { { CODEC_ID_PCM_S8, MKTAG('t', 'w', 'o', 's')}, { CODEC_ID_PCM_U8, 1}, { CODEC_ID_PCM_S16BE, MKTAG('t', 'w', 'o', 's')}, @@ -65,9 +69,9 @@ static const AVCodecTag mp_wav_override_tags[] = { { 0, 0 }, }; -const struct AVCodecTag *mp_wav_override_taglists[] = {mp_wav_override_tags, 0}; +const struct mp_AVCodecTag *mp_wav_override_taglists[] = {mp_wav_override_tags, 0}; -static const AVCodecTag mp_bmp_tags[] = { +static const struct mp_AVCodecTag mp_bmp_tags[] = { { CODEC_ID_AMV, MKTAG('A', 'M', 'V', 'V')}, { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')}, { CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')}, @@ -96,4 +100,4 @@ static const AVCodecTag mp_bmp_tags[] = { { 0, 0 }, }; -const struct AVCodecTag *mp_bmp_taglists[] = {ff_codec_bmp_tags, mp_bmp_tags, 0}; +const struct mp_AVCodecTag *mp_bmp_taglists[] = {mp_ff_codec_bmp_tags, mp_bmp_tags, 0}; diff --git a/libmpdemux/mp_taglists.h b/libmpdemux/mp_taglists.h index a5262652b7..daa9c2dbcc 100644 --- a/libmpdemux/mp_taglists.h +++ b/libmpdemux/mp_taglists.h @@ -19,10 +19,14 @@ #ifndef MPLAYER_MP_TAGLISTS_H #define MPLAYER_MP_TAGLISTS_H -extern const struct AVCodecTag *mp_wav_taglists[]; +#include <libavcodec/avcodec.h> -extern const struct AVCodecTag *mp_wav_override_taglists[]; +#include "ffmpeg_files/taglists.h" -extern const struct AVCodecTag *mp_bmp_taglists[]; +extern const struct mp_AVCodecTag *mp_wav_taglists[]; + +extern const struct mp_AVCodecTag *mp_wav_override_taglists[]; + +extern const struct mp_AVCodecTag *mp_bmp_taglists[]; #endif /* MPLAYER_MP_TAGLISTS_H */ diff --git a/libmpdemux/muxer_lavf.c b/libmpdemux/muxer_lavf.c index 7a73706589..9913399a87 100644 --- a/libmpdemux/muxer_lavf.c +++ b/libmpdemux/muxer_lavf.c @@ -197,7 +197,7 @@ static void fix_parameters(muxer_stream_t *stream) if(stream->type == MUXER_TYPE_AUDIO) { - ctx->codec_id = av_codec_get_id(mp_wav_taglists, stream->wf->wFormatTag); + ctx->codec_id = mp_av_codec_get_id(mp_wav_taglists, stream->wf->wFormatTag); #if 0 //breaks aac in mov at least ctx->codec_tag = codec_get_wav_tag(ctx->codec_id); #endif @@ -226,7 +226,7 @@ static void fix_parameters(muxer_stream_t *stream) } else if(stream->type == MUXER_TYPE_VIDEO) { - ctx->codec_id = av_codec_get_id(mp_bmp_taglists, stream->bih->biCompression); + ctx->codec_id = mp_av_codec_get_id(mp_bmp_taglists, stream->bih->biCompression); if(ctx->codec_id <= 0 || force_fourcc) ctx->codec_tag= stream->bih->biCompression; mp_msg(MSGT_MUXER, MSGL_INFO, "VIDEO CODEC ID: %d\n", ctx->codec_id); |