aboutsummaryrefslogtreecommitdiff
path: root/libavformat/g729dec.c
diff options
context:
space:
mode:
authorDerek Buitenhuis2016-04-10 20:58:15 +0100
committerDerek Buitenhuis2016-04-10 20:59:55 +0100
commit6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch)
tree0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/g729dec.c
parent60b75186b2c878b6257b43c8fcc0b1356ada218e (diff)
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
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/g729dec.c')
-rw-r--r--libavformat/g729dec.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/g729dec.c b/libavformat/g729dec.c
index 349a014340..ee855d22d9 100644
--- a/libavformat/g729dec.c
+++ b/libavformat/g729dec.c
@@ -38,10 +38,10 @@ static int g729_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->codec_id = AV_CODEC_ID_G729;
- st->codec->sample_rate = 8000;
- st->codec->channels = 1;
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_G729;
+ st->codecpar->sample_rate = 8000;
+ st->codecpar->channels = 1;
if (s1 && s1->bit_rate) {
s->bit_rate = s1->bit_rate;
@@ -53,28 +53,28 @@ static int g729_read_header(AVFormatContext *s)
}
if (s->bit_rate == 6400) {
- st->codec->block_align = 8;
+ st->codecpar->block_align = 8;
} else if (s->bit_rate == 8000) {
- st->codec->block_align = 10;
+ st->codecpar->block_align = 10;
} else {
av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %"PRId64" b/s\n", (int64_t)s->bit_rate);
return AVERROR_INVALIDDATA;
}
- avpriv_set_pts_info(st, st->codec->block_align << 3, 1, st->codec->sample_rate);
+ avpriv_set_pts_info(st, st->codecpar->block_align << 3, 1, st->codecpar->sample_rate);
return 0;
}
static int g729_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int ret;
- ret = av_get_packet(s->pb, pkt, s->streams[0]->codec->block_align);
+ ret = av_get_packet(s->pb, pkt, s->streams[0]->codecpar->block_align);
pkt->stream_index = 0;
if (ret < 0)
return ret;
- pkt->dts = pkt->pts = pkt->pos / s->streams[0]->codec->block_align;
+ pkt->dts = pkt->pts = pkt->pos / s->streams[0]->codecpar->block_align;
return ret;
}