diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:58:15 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:59:55 +0100 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/omaenc.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) | |
download | ffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz |
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
lavf: replace AVStream.codec with AVStream.codecpar
This has been a HUGE effort from:
- Derek Buitenhuis <derek.buitenhuis@gmail.com>
- Hendrik Leppkes <h.leppkes@gmail.com>
- wm4 <nfxjfg@googlemail.com>
- Clément Bœsch <clement@stupeflix.com>
- James Almer <jamrial@gmail.com>
- Michael Niedermayer <michael@niedermayer.cc>
- Rostislav Pehlivanov <atomnuker@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/omaenc.c')
-rw-r--r-- | libavformat/omaenc.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c index fe0669f5c9..d89cc37ee0 100644 --- a/libavformat/omaenc.c +++ b/libavformat/omaenc.c @@ -30,21 +30,21 @@ static av_cold int oma_write_header(AVFormatContext *s) { int i; - AVCodecContext *format; + AVCodecParameters *par; int srate_index; int isjointstereo; - format = s->streams[0]->codec; + par = s->streams[0]->codecpar; /* check for support of the format first */ for (srate_index = 0; ; srate_index++) { if (ff_oma_srate_tab[srate_index] == 0) { av_log(s, AV_LOG_ERROR, "Sample rate %d not supported in OpenMG audio\n", - format->sample_rate); + par->sample_rate); return AVERROR(EINVAL); } - if (ff_oma_srate_tab[srate_index] * 100 == format->sample_rate) + if (ff_oma_srate_tab[srate_index] * 100 == par->sample_rate) break; } @@ -58,16 +58,16 @@ static av_cold int oma_write_header(AVFormatContext *s) for (i = 0; i < 6; i++) avio_wl32(s->pb, 0); /* Padding + DRM id */ - switch(format->codec_tag) { + switch (par->codec_tag) { case OMA_CODECID_ATRAC3: - if (format->channels != 2) { + if (par->channels != 2) { av_log(s, AV_LOG_ERROR, "ATRAC3 in OMA is only supported with 2 channels\n"); return AVERROR(EINVAL); } - if (format->extradata_size == 14) /* WAV format extradata */ - isjointstereo = format->extradata[6] != 0; - else if(format->extradata_size == 10) /* RM format extradata */ - isjointstereo = format->extradata[8] == 0x12; + if (par->extradata_size == 14) /* WAV format extradata */ + isjointstereo = par->extradata[6] != 0; + else if(par->extradata_size == 10) /* RM format extradata */ + isjointstereo = par->extradata[8] == 0x12; else { av_log(s, AV_LOG_ERROR, "ATRAC3: Unsupported extradata size\n"); return AVERROR(EINVAL); @@ -75,17 +75,17 @@ static av_cold int oma_write_header(AVFormatContext *s) avio_wb32(s->pb, (OMA_CODECID_ATRAC3 << 24) | (isjointstereo << 17) | (srate_index << 13) | - (format->block_align/8)); + (par->block_align/8)); break; case OMA_CODECID_ATRAC3P: avio_wb32(s->pb, (OMA_CODECID_ATRAC3P << 24) | (srate_index << 13) | - (format->channels << 10) | - (format->block_align/8 - 1)); + (par->channels << 10) | + (par->block_align/8 - 1)); break; default: av_log(s, AV_LOG_ERROR, "unsupported codec tag %d for write\n", - format->codec_tag); + par->codec_tag); return AVERROR(EINVAL); } for (i = 0; i < (EA3_HEADER_SIZE - 36)/4; i++) |