Browse Source

riff: Use the correct logging context

tags/n2.8
Luca Barbato 10 years ago
parent
commit
d80811c94e
10 changed files with 13 additions and 12 deletions
  1. +1
    -1
      libavformat/asfdec.c
  2. +1
    -1
      libavformat/avidec.c
  3. +1
    -1
      libavformat/dxa.c
  4. +1
    -1
      libavformat/matroskadec.c
  5. +1
    -1
      libavformat/mov.c
  6. +1
    -1
      libavformat/riff.h
  7. +3
    -2
      libavformat/riffdec.c
  8. +2
    -2
      libavformat/wavdec.c
  9. +1
    -1
      libavformat/wtv.c
  10. +1
    -1
      libavformat/xwma.c

+ 1
- 1
libavformat/asfdec.c View File

@@ -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)
if ((ret = ff_get_wav_header(s, pb, st->codec, ts_data_len)) < 0)
return ret; return ret;
break; break;
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:


+ 1
- 1
libavformat/avidec.c View File

@@ -708,7 +708,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);
ret = ff_get_wav_header(s, pb, st->codec, size);
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;


+ 1
- 1
libavformat/dxa.c View File

@@ -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 -1; return -1;
ret = ff_get_wav_header(pb, ast->codec, fsize);
ret = ff_get_wav_header(s, pb, ast->codec, fsize);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ast->codec->sample_rate > 0) if (ast->codec->sample_rate > 0)


+ 1
- 1
libavformat/matroskadec.c View File

@@ -1597,7 +1597,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);
ret = ff_get_wav_header(s, &b, st->codec, track->codec_priv.size);
if (ret < 0) if (ret < 0)
return ret; return ret;
codec_id = st->codec->codec_id; codec_id = st->codec->codec_id;


+ 1
- 1
libavformat/mov.c View File

@@ -758,7 +758,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];


return ff_get_wav_header(pb, st->codec, atom.size);
return ff_get_wav_header(c->fc, pb, st->codec, atom.size);
} }


static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom) static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom)


+ 1
- 1
libavformat/riff.h View File

@@ -48,7 +48,7 @@ int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf); void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc); int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
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 ff_get_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecContext *codec, int size);


extern const AVCodecTag ff_codec_bmp_tags[]; extern const AVCodecTag ff_codec_bmp_tags[];
extern const AVCodecTag ff_codec_wav_tags[]; extern const AVCodecTag ff_codec_wav_tags[];


+ 3
- 2
libavformat/riffdec.c View File

@@ -75,7 +75,8 @@ static void parse_waveformatex(AVIOContext *pb, AVCodecContext *c)
} }
} }


int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
int ff_get_wav_header(AVFormatContext *s, AVIOContext *pb,
AVCodecContext *codec, int size)
{ {
int id; int id;


@@ -124,7 +125,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
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;
} }


+ 2
- 2
libavformat/wavdec.c View File

@@ -102,7 +102,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);
ret = ff_get_wav_header(s, pb, (*st)->codec, size);
if (ret < 0) if (ret < 0)
return ret; return ret;
(*st)->need_parsing = AVSTREAM_PARSE_FULL; (*st)->need_parsing = AVSTREAM_PARSE_FULL;
@@ -498,7 +498,7 @@ static int w64_read_header(AVFormatContext *s)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);


/* 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);
ret = ff_get_wav_header(s, pb, st->codec, size - 24);
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);


+ 1
- 1
libavformat/wtv.c View File

@@ -691,7 +691,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
if (!st) if (!st)
return NULL; return NULL;
if (!ff_guidcmp(formattype, format_waveformatex)) { if (!ff_guidcmp(formattype, format_waveformatex)) {
int ret = ff_get_wav_header(pb, st->codec, size);
int ret = ff_get_wav_header(s, pb, st->codec, size);
if (ret < 0) if (ret < 0)
return NULL; return NULL;
} else { } else {


+ 1
- 1
libavformat/xwma.c View File

@@ -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);
ret = ff_get_wav_header(s, pb, st->codec, size);
if (ret < 0) if (ret < 0)
return ret; return ret;
st->need_parsing = AVSTREAM_PARSE_NONE; st->need_parsing = AVSTREAM_PARSE_NONE;


Loading…
Cancel
Save