Commit ba77fb61 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'd80811c9'

* commit 'd80811c9':
  riff: Use the correct logging context

Conflicts:
	libavformat/asfdec_o.c
	libavformat/avidec.c
	libavformat/dxa.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/riff.h
	libavformat/riffdec.c
	libavformat/wavdec.c
	libavformat/wtvdec.c
	libavformat/xwma.c
Merged-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parents e72988d3 d80811c9
...@@ -75,7 +75,7 @@ static int read_header(AVFormatContext *s) ...@@ -75,7 +75,7 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 16); avio_skip(pb, 16);
size=avio_rl32(pb); size=avio_rl32(pb);
ff_get_wav_header(pb, st->codec, size, 0); ff_get_wav_header(s, pb, st->codec, size, 0);
/* /*
8000Hz (Fine-rec) file format has 10 bytes long 8000Hz (Fine-rec) file format has 10 bytes long
......
...@@ -470,7 +470,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) ...@@ -470,7 +470,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
st->codec->codec_type = type; st->codec->codec_type = type;
if (type == AVMEDIA_TYPE_AUDIO) { if (type == AVMEDIA_TYPE_AUDIO) {
int ret = ff_get_wav_header(pb, st->codec, type_specific_size, 0); int ret = ff_get_wav_header(s, pb, st->codec, type_specific_size, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (is_dvr_ms_audio) { if (is_dvr_ms_audio) {
......
...@@ -752,7 +752,7 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable * ...@@ -752,7 +752,7 @@ static int asf_read_stream_properties(AVFormatContext *s, const GUIDParseTable *
switch (type) { switch (type) {
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
asf_st->type = AVMEDIA_TYPE_AUDIO; asf_st->type = AVMEDIA_TYPE_AUDIO;
if ((ret = ff_get_wav_header(pb, st->codec, ts_data_len, 0)) < 0) if ((ret = ff_get_wav_header(s, pb, st->codec, ts_data_len, 0)) < 0)
return ret; return ret;
break; break;
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
......
...@@ -835,7 +835,7 @@ static int avi_read_header(AVFormatContext *s) ...@@ -835,7 +835,7 @@ static int avi_read_header(AVFormatContext *s)
// avio_skip(pb, size - 5 * 4); // avio_skip(pb, size - 5 * 4);
break; break;
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
ret = ff_get_wav_header(pb, st->codec, size, 0); ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
ast->dshow_block_align = st->codec->block_align; ast->dshow_block_align = st->codec->block_align;
......
...@@ -106,7 +106,7 @@ static int dxa_read_header(AVFormatContext *s) ...@@ -106,7 +106,7 @@ static int dxa_read_header(AVFormatContext *s)
ast = avformat_new_stream(s, NULL); ast = avformat_new_stream(s, NULL);
if (!ast) if (!ast)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ret = ff_get_wav_header(pb, ast->codec, fsize, 0); ret = ff_get_wav_header(s, pb, ast->codec, fsize, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ast->codec->sample_rate > 0) if (ast->codec->sample_rate > 0)
......
...@@ -1792,7 +1792,7 @@ static int matroska_parse_tracks(AVFormatContext *s) ...@@ -1792,7 +1792,7 @@ static int matroska_parse_tracks(AVFormatContext *s)
ffio_init_context(&b, track->codec_priv.data, ffio_init_context(&b, track->codec_priv.data,
track->codec_priv.size, track->codec_priv.size,
0, NULL, NULL, NULL, NULL); 0, NULL, NULL, NULL, NULL);
ret = ff_get_wav_header(&b, st->codec, track->codec_priv.size, 0); ret = ff_get_wav_header(s, &b, st->codec, track->codec_priv.size, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
codec_id = st->codec->codec_id; codec_id = st->codec->codec_id;
......
...@@ -143,7 +143,7 @@ static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int f ...@@ -143,7 +143,7 @@ static int scan_file(AVFormatContext *avctx, AVStream *vst, AVStream *ast, int f
vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16); vst->codec->codec_tag = MKTAG('B', 'I', 'T', 16);
size -= 164; size -= 164;
} else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) { } else if (ast && type == MKTAG('W', 'A', 'V', 'I') && size >= 16) {
ret = ff_get_wav_header(pb, ast->codec, 16, 0); ret = ff_get_wav_header(avctx, pb, ast->codec, 16, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
size -= 16; size -= 16;
......
...@@ -769,7 +769,7 @@ static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -769,7 +769,7 @@ static int mov_read_wfex(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0; return 0;
st = c->fc->streams[c->fc->nb_streams-1]; st = c->fc->streams[c->fc->nb_streams-1];
if ((ret = ff_get_wav_header(pb, st->codec, atom.size, 0)) < 0) if ((ret = ff_get_wav_header(c->fc, pb, st->codec, atom.size, 0)) < 0)
av_log(c->fc, AV_LOG_WARNING, "get_wav_header failed\n"); av_log(c->fc, AV_LOG_WARNING, "get_wav_header failed\n");
return ret; return ret;
......
...@@ -62,7 +62,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t ...@@ -62,7 +62,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags); int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags);
enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps); enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps);
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_endian); int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int size, int big_endian);
extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags() extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags()
extern const AVCodecTag ff_codec_wav_tags[]; extern const AVCodecTag ff_codec_wav_tags[];
......
...@@ -83,7 +83,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecContext *c) ...@@ -83,7 +83,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecContext *c)
} }
/* "big_endian" values are needed for RIFX file format */ /* "big_endian" values are needed for RIFX file format */
int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_endian) int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
AVCodecContext *codec, int size, int big_endian)
{ {
int id; int id;
...@@ -147,7 +148,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_ ...@@ -147,7 +148,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_
avio_skip(pb, size); avio_skip(pb, size);
} }
if (codec->sample_rate <= 0) { if (codec->sample_rate <= 0) {
av_log(NULL, AV_LOG_ERROR, av_log(s, AV_LOG_ERROR,
"Invalid sample rate: %d\n", codec->sample_rate); "Invalid sample rate: %d\n", codec->sample_rate);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
......
...@@ -134,7 +134,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st) ...@@ -134,7 +134,7 @@ static int wav_parse_fmt_tag(AVFormatContext *s, int64_t size, AVStream **st)
if (!*st) if (!*st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ret = ff_get_wav_header(pb, (*st)->codec, size, wav->rifx); ret = ff_get_wav_header(s, pb, (*st)->codec, size, wav->rifx);
if (ret < 0) if (ret < 0)
return ret; return ret;
handle_stream_probing(*st); handle_stream_probing(*st);
...@@ -689,7 +689,7 @@ static int w64_read_header(AVFormatContext *s) ...@@ -689,7 +689,7 @@ static int w64_read_header(AVFormatContext *s)
if (!memcmp(guid, ff_w64_guid_fmt, 16)) { if (!memcmp(guid, ff_w64_guid_fmt, 16)) {
/* subtract chunk header size - normal wav file doesn't count it */ /* subtract chunk header size - normal wav file doesn't count it */
ret = ff_get_wav_header(pb, st->codec, size - 24, 0); ret = ff_get_wav_header(s, pb, st->codec, size - 24, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
avio_skip(pb, FFALIGN(size, INT64_C(8)) - size); avio_skip(pb, FFALIGN(size, INT64_C(8)) - size);
......
...@@ -670,7 +670,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, ...@@ -670,7 +670,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
if (!st) if (!st)
return NULL; return NULL;
if (!ff_guidcmp(formattype, ff_format_waveformatex)) { if (!ff_guidcmp(formattype, ff_format_waveformatex)) {
int ret = ff_get_wav_header(pb, st->codec, size, 0); int ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0) if (ret < 0)
return NULL; return NULL;
} else { } else {
......
...@@ -75,7 +75,7 @@ static int xwma_read_header(AVFormatContext *s) ...@@ -75,7 +75,7 @@ static int xwma_read_header(AVFormatContext *s)
if (!st) if (!st)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
ret = ff_get_wav_header(pb, st->codec, size, 0); ret = ff_get_wav_header(s, pb, st->codec, size, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
st->need_parsing = AVSTREAM_PARSE_NONE; st->need_parsing = AVSTREAM_PARSE_NONE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment