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/westwood_aud.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/westwood_aud.c')
-rw-r--r-- | libavformat/westwood_aud.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c index 6d8dbdbd35..fe8bdb01c2 100644 --- a/libavformat/westwood_aud.c +++ b/libavformat/westwood_aud.c @@ -105,23 +105,23 @@ static int wsaud_read_header(AVFormatContext *s) avpriv_request_sample(s, "Stereo WS-SND1"); return AVERROR_PATCHWELCOME; } - st->codec->codec_id = AV_CODEC_ID_WESTWOOD_SND1; + st->codecpar->codec_id = AV_CODEC_ID_WESTWOOD_SND1; break; case 99: - st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS; - st->codec->bits_per_coded_sample = 4; - st->codec->bit_rate = channels * sample_rate * 4; + st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_WS; + st->codecpar->bits_per_coded_sample = 4; + st->codecpar->bit_rate = channels * sample_rate * 4; break; default: avpriv_request_sample(s, "Unknown codec: %d", codec); return AVERROR_PATCHWELCOME; } avpriv_set_pts_info(st, 64, 1, sample_rate); - st->codec->codec_type = AVMEDIA_TYPE_AUDIO; - st->codec->channels = channels; - st->codec->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO : - AV_CH_LAYOUT_STEREO; - st->codec->sample_rate = sample_rate; + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; + st->codecpar->channels = channels; + st->codecpar->channel_layout = channels == 1 ? AV_CH_LAYOUT_MONO : + AV_CH_LAYOUT_STEREO; + st->codecpar->sample_rate = sample_rate; return 0; } @@ -145,7 +145,7 @@ static int wsaud_read_packet(AVFormatContext *s, chunk_size = AV_RL16(&preamble[0]); - if (st->codec->codec_id == AV_CODEC_ID_WESTWOOD_SND1) { + if (st->codecpar->codec_id == AV_CODEC_ID_WESTWOOD_SND1) { /* For Westwood SND1 audio we need to add the output size and input size to the start of the packet to match what is in VQA. Specifically, this is needed to signal when a packet should be @@ -165,7 +165,7 @@ static int wsaud_read_packet(AVFormatContext *s, return AVERROR(EIO); /* 2 samples/byte, 1 or 2 samples per frame depending on stereo */ - pkt->duration = (chunk_size * 2) / st->codec->channels; + pkt->duration = (chunk_size * 2) / st->codecpar->channels; } pkt->stream_index = st->index; |