summaryrefslogtreecommitdiff
path: root/libavformat/soxdec.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/soxdec.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/soxdec.c')
-rw-r--r--libavformat/soxdec.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index aec42843cb..0a937e7cc7 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -55,21 +55,21 @@ static int sox_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
if (avio_rl32(pb) == SOX_TAG) {
- st->codec->codec_id = AV_CODEC_ID_PCM_S32LE;
+ st->codecpar->codec_id = AV_CODEC_ID_PCM_S32LE;
header_size = avio_rl32(pb);
avio_skip(pb, 8); /* sample count */
sample_rate = av_int2double(avio_rl64(pb));
- st->codec->channels = avio_rl32(pb);
+ st->codecpar->channels = avio_rl32(pb);
comment_size = avio_rl32(pb);
} else {
- st->codec->codec_id = AV_CODEC_ID_PCM_S32BE;
+ st->codecpar->codec_id = AV_CODEC_ID_PCM_S32BE;
header_size = avio_rb32(pb);
avio_skip(pb, 8); /* sample count */
sample_rate = av_int2double(avio_rb64(pb));
- st->codec->channels = avio_rb32(pb);
+ st->codecpar->channels = avio_rb32(pb);
comment_size = avio_rb32(pb);
}
@@ -90,7 +90,7 @@ static int sox_read_header(AVFormatContext *s)
sample_rate_frac);
if ((header_size + 4) & 7 || header_size < SOX_FIXED_HDR + comment_size
- || st->codec->channels > 65535) /* Reserve top 16 bits */ {
+ || st->codecpar->channels > 65535) /* Reserve top 16 bits */ {
av_log(s, AV_LOG_ERROR, "invalid header\n");
return AVERROR_INVALIDDATA;
}
@@ -111,15 +111,15 @@ static int sox_read_header(AVFormatContext *s)
avio_skip(pb, header_size - SOX_FIXED_HDR - comment_size);
- st->codec->sample_rate = sample_rate;
- st->codec->bits_per_coded_sample = 32;
- st->codec->bit_rate = st->codec->sample_rate *
- st->codec->bits_per_coded_sample *
- st->codec->channels;
- st->codec->block_align = st->codec->bits_per_coded_sample *
- st->codec->channels / 8;
+ st->codecpar->sample_rate = sample_rate;
+ st->codecpar->bits_per_coded_sample = 32;
+ st->codecpar->bit_rate = st->codecpar->sample_rate *
+ st->codecpar->bits_per_coded_sample *
+ st->codecpar->channels;
+ st->codecpar->block_align = st->codecpar->bits_per_coded_sample *
+ st->codecpar->channels / 8;
- avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
+ avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
return 0;
}