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/nistspheredec.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/nistspheredec.c')
-rw-r--r-- | libavformat/nistspheredec.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c index 359d9e38a5..782d1dfbfb 100644 --- a/libavformat/nistspheredec.c +++ b/libavformat/nistspheredec.c @@ -43,7 +43,7 @@ static int nist_read_header(AVFormatContext *s) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; ff_get_line(s->pb, buffer, sizeof(buffer)); ff_get_line(s->pb, buffer, sizeof(buffer)); @@ -58,29 +58,29 @@ static int nist_read_header(AVFormatContext *s) return AVERROR_INVALIDDATA; if (!memcmp(buffer, "end_head", 8)) { - if (!st->codec->bits_per_coded_sample) - st->codec->bits_per_coded_sample = bps << 3; + if (!st->codecpar->bits_per_coded_sample) + st->codecpar->bits_per_coded_sample = bps << 3; if (!av_strcasecmp(coding, "pcm")) { - if (st->codec->codec_id == AV_CODEC_ID_NONE) - st->codec->codec_id = ff_get_pcm_codec_id(st->codec->bits_per_coded_sample, + if (st->codecpar->codec_id == AV_CODEC_ID_NONE) + st->codecpar->codec_id = ff_get_pcm_codec_id(st->codecpar->bits_per_coded_sample, 0, be, 0xFFFF); } else if (!av_strcasecmp(coding, "alaw")) { - st->codec->codec_id = AV_CODEC_ID_PCM_ALAW; + st->codecpar->codec_id = AV_CODEC_ID_PCM_ALAW; } else if (!av_strcasecmp(coding, "ulaw") || !av_strcasecmp(coding, "mu-law")) { - st->codec->codec_id = AV_CODEC_ID_PCM_MULAW; + st->codecpar->codec_id = AV_CODEC_ID_PCM_MULAW; } else if (!av_strncasecmp(coding, "pcm,embedded-shorten", 20)) { - st->codec->codec_id = AV_CODEC_ID_SHORTEN; - if (ff_alloc_extradata(st->codec, 1)) - st->codec->extradata[0] = 1; + st->codecpar->codec_id = AV_CODEC_ID_SHORTEN; + if (ff_alloc_extradata(st->codecpar, 1)) + st->codecpar->extradata[0] = 1; } else { avpriv_request_sample(s, "coding %s", coding); } - avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); + avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); - st->codec->block_align = st->codec->bits_per_coded_sample * st->codec->channels / 8; + st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8; if (avio_tell(s->pb) > header_size) return AVERROR_INVALIDDATA; @@ -89,7 +89,7 @@ static int nist_read_header(AVFormatContext *s) return 0; } else if (!memcmp(buffer, "channel_count", 13)) { - sscanf(buffer, "%*s %*s %"SCNd32, &st->codec->channels); + sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->channels); } else if (!memcmp(buffer, "sample_byte_format", 18)) { sscanf(buffer, "%*s %*s %31s", format); @@ -98,7 +98,7 @@ static int nist_read_header(AVFormatContext *s) } else if (!av_strcasecmp(format, "10")) { be = 1; } else if (!av_strcasecmp(format, "mu-law")) { - st->codec->codec_id = AV_CODEC_ID_PCM_MULAW; + st->codecpar->codec_id = AV_CODEC_ID_PCM_MULAW; } else if (av_strcasecmp(format, "1")) { avpriv_request_sample(s, "sample byte format %s", format); return AVERROR_PATCHWELCOME; @@ -110,9 +110,9 @@ static int nist_read_header(AVFormatContext *s) } else if (!memcmp(buffer, "sample_n_bytes", 14)) { sscanf(buffer, "%*s %*s %"SCNd32, &bps); } else if (!memcmp(buffer, "sample_rate", 11)) { - sscanf(buffer, "%*s %*s %"SCNd32, &st->codec->sample_rate); + sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->sample_rate); } else if (!memcmp(buffer, "sample_sig_bits", 15)) { - sscanf(buffer, "%*s %*s %"SCNd32, &st->codec->bits_per_coded_sample); + sscanf(buffer, "%*s %*s %"SCNd32, &st->codecpar->bits_per_coded_sample); } else { char key[32], value[32]; if (sscanf(buffer, "%31s %*s %31s", key, value) == 2) { |