aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/adxdec.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:58:15 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/adxdec.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-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/adxdec.c')
-rw-r--r--libavformat/adxdec.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c
index 05cef0b07c..fd096702c9 100644
--- a/libavformat/adxdec.c
+++ b/libavformat/adxdec.c
@@ -50,15 +50,15 @@ static int adx_probe(AVProbeData *p)
static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
{
ADXDemuxerContext *c = s->priv_data;
- AVCodecContext *avctx = s->streams[0]->codec;
+ AVCodecParameters *par = s->streams[0]->codecpar;
int ret, size;
- if (avctx->channels <= 0) {
- av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", avctx->channels);
+ if (par->channels <= 0) {
+ av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", par->channels);
return AVERROR_INVALIDDATA;
}
- size = BLOCK_SIZE * avctx->channels;
+ size = BLOCK_SIZE * par->channels;
pkt->pos = avio_tell(s->pb);
pkt->stream_index = 0;
@@ -82,37 +82,37 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
static int adx_read_header(AVFormatContext *s)
{
ADXDemuxerContext *c = s->priv_data;
- AVCodecContext *avctx;
+ AVCodecParameters *par;
AVStream *st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
- avctx = s->streams[0]->codec;
+ par = s->streams[0]->codecpar;
if (avio_rb16(s->pb) != 0x8000)
return AVERROR_INVALIDDATA;
c->header_size = avio_rb16(s->pb) + 4;
avio_seek(s->pb, -4, SEEK_CUR);
- if (ff_get_extradata(avctx, s->pb, c->header_size) < 0)
+ if (ff_get_extradata(par, s->pb, c->header_size) < 0)
return AVERROR(ENOMEM);
- if (avctx->extradata_size < 12) {
+ if (par->extradata_size < 12) {
av_log(s, AV_LOG_ERROR, "Invalid extradata size.\n");
return AVERROR_INVALIDDATA;
}
- avctx->channels = AV_RB8(avctx->extradata + 7);
- avctx->sample_rate = AV_RB32(avctx->extradata + 8);
+ par->channels = AV_RB8 (par->extradata + 7);
+ par->sample_rate = AV_RB32(par->extradata + 8);
- if (avctx->channels <= 0) {
- av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", avctx->channels);
+ if (par->channels <= 0) {
+ av_log(s, AV_LOG_ERROR, "invalid number of channels %d\n", par->channels);
return AVERROR_INVALIDDATA;
}
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->codec_id = s->iformat->raw_codec_id;
+ par->codec_type = AVMEDIA_TYPE_AUDIO;
+ par->codec_id = s->iformat->raw_codec_id;
- avpriv_set_pts_info(st, 64, BLOCK_SAMPLES, avctx->sample_rate);
+ avpriv_set_pts_info(st, 64, BLOCK_SAMPLES, par->sample_rate);
return 0;
}