mirror of https://github.com/mpv-player/mpv
Simplify by using av_codec_get_id and include riff.h only in demux_lavf.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21984 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
c300337919
commit
4b9ddc69a0
|
@ -31,12 +31,10 @@ static int compressed_frame_size = 0;
|
|||
#if defined(USE_LIBAVFORMAT) || defined(USE_LIBAVFORMAT_SO)
|
||||
#ifdef USE_LIBAVFORMAT_SO
|
||||
#include <ffmpeg/avformat.h>
|
||||
#include <ffmpeg/riff.h>
|
||||
#else
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/riff.h"
|
||||
#endif
|
||||
extern const AVCodecTag mp_wav_tags[];
|
||||
extern const struct AVCodecTag *mp_wav_taglists[];
|
||||
#endif
|
||||
|
||||
static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a)
|
||||
|
@ -182,9 +180,7 @@ int mpae_init_lavc(audio_encoder_t *encoder)
|
|||
if(lavc_param_atag == 0)
|
||||
{
|
||||
#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);
|
||||
lavc_param_atag = av_codec_get_tag(mp_wav_taglists, lavc_acodec->id);
|
||||
#else
|
||||
lavc_param_atag = lavc_find_atag(lavc_param_acodec);
|
||||
#endif
|
||||
|
|
|
@ -67,7 +67,7 @@ extern void print_video_header(BITMAPINFOHEADER *h, int verbose_level);
|
|||
|
||||
int64_t ff_gcd(int64_t a, int64_t b);
|
||||
|
||||
const AVCodecTag mp_wav_tags[] = {
|
||||
static const AVCodecTag mp_wav_tags[] = {
|
||||
{ CODEC_ID_ADPCM_4XM, MKTAG('4', 'X', 'M', 'A')},
|
||||
{ CODEC_ID_ADPCM_EA, MKTAG('A', 'D', 'E', 'A')},
|
||||
{ CODEC_ID_ADPCM_IMA_WS, MKTAG('A', 'I', 'W', 'S')},
|
||||
|
@ -86,7 +86,9 @@ const AVCodecTag mp_wav_tags[] = {
|
|||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const AVCodecTag mp_bmp_tags[] = {
|
||||
const struct AVCodecTag *mp_wav_taglists[] = {codec_wav_tags, mp_wav_tags, 0};
|
||||
|
||||
static const AVCodecTag mp_bmp_tags[] = {
|
||||
{ CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')},
|
||||
{ CODEC_ID_FLIC, MKTAG('F', 'L', 'I', 'C')},
|
||||
{ CODEC_ID_IDCIN, MKTAG('I', 'D', 'C', 'I')},
|
||||
|
@ -99,6 +101,8 @@ const AVCodecTag mp_bmp_tags[] = {
|
|||
{ 0, 0 },
|
||||
};
|
||||
|
||||
const struct AVCodecTag *mp_bmp_taglists[] = {codec_bmp_tags, mp_bmp_tags, 0};
|
||||
|
||||
static int mp_open(URLContext *h, const char *filename, int flags){
|
||||
return 0;
|
||||
}
|
||||
|
@ -252,9 +256,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
|
|||
priv->astreams[priv->audio_streams] = i;
|
||||
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);
|
||||
codec->codec_tag= av_codec_get_tag(mp_wav_taglists, codec->codec_id);
|
||||
wf->wFormatTag= codec->codec_tag;
|
||||
wf->nChannels= codec->channels;
|
||||
wf->nSamplesPerSec= codec->sample_rate;
|
||||
|
@ -326,9 +328,7 @@ static demuxer_t* demux_open_lavf(demuxer_t *demuxer){
|
|||
bih=calloc(sizeof(BITMAPINFOHEADER) + codec->extradata_size,1);
|
||||
|
||||
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);
|
||||
codec->codec_tag= 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;
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
#else
|
||||
#include "avformat.h"
|
||||
#endif
|
||||
#include "libavformat/riff.h"
|
||||
|
||||
extern const AVCodecTag mp_wav_tags[];
|
||||
extern const struct AVCodecTag *mp_wav_taglists[];
|
||||
extern const struct AVCodecTag *mp_bmp_taglists[];
|
||||
|
||||
extern char *info_name;
|
||||
extern char *info_artist;
|
||||
|
@ -207,9 +207,7 @@ static void fix_parameters(muxer_stream_t *stream)
|
|||
|
||||
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);
|
||||
ctx->codec_id = 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
|
||||
|
@ -238,7 +236,7 @@ static void fix_parameters(muxer_stream_t *stream)
|
|||
}
|
||||
else if(stream->type == MUXER_TYPE_VIDEO)
|
||||
{
|
||||
ctx->codec_id = codec_get_bmp_id(stream->bih->biCompression);
|
||||
ctx->codec_id = 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);
|
||||
|
|
Loading…
Reference in New Issue