summaryrefslogtreecommitdiff
path: root/libavformat/sierravmd.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/sierravmd.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/sierravmd.c')
-rw-r--r--libavformat/sierravmd.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c
index 2ab0e38a1c..882f70e9ee 100644
--- a/libavformat/sierravmd.c
+++ b/libavformat/sierravmd.c
@@ -118,18 +118,18 @@ static int vmd_read_header(AVFormatContext *s)
return AVERROR(ENOMEM);
avpriv_set_pts_info(vst, 33, 1, 10);
vmd->video_stream_index = vst->index;
- vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
- vst->codec->codec_id = vmd->is_indeo3 ? AV_CODEC_ID_INDEO3 : AV_CODEC_ID_VMDVIDEO;
- vst->codec->codec_tag = 0; /* no fourcc */
- vst->codec->width = width;
- vst->codec->height = height;
- if(vmd->is_indeo3 && vst->codec->width > 320){
- vst->codec->width >>= 1;
- vst->codec->height >>= 1;
+ vst->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
+ vst->codecpar->codec_id = vmd->is_indeo3 ? AV_CODEC_ID_INDEO3 : AV_CODEC_ID_VMDVIDEO;
+ vst->codecpar->codec_tag = 0; /* no fourcc */
+ vst->codecpar->width = width;
+ vst->codecpar->height = height;
+ if(vmd->is_indeo3 && vst->codecpar->width > 320){
+ vst->codecpar->width >>= 1;
+ vst->codecpar->height >>= 1;
}
- if (ff_alloc_extradata(vst->codec, VMD_HEADER_SIZE))
+ if (ff_alloc_extradata(vst->codecpar, VMD_HEADER_SIZE))
return AVERROR(ENOMEM);
- memcpy(vst->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
+ memcpy(vst->codecpar->extradata, vmd->vmd_header, VMD_HEADER_SIZE);
}
/* if sample rate is 0, assume no audio */
@@ -139,30 +139,30 @@ static int vmd_read_header(AVFormatContext *s)
if (!st)
return AVERROR(ENOMEM);
vmd->audio_stream_index = st->index;
- st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->codec_id = AV_CODEC_ID_VMDAUDIO;
- st->codec->codec_tag = 0; /* no fourcc */
+ st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
+ st->codecpar->codec_id = AV_CODEC_ID_VMDAUDIO;
+ st->codecpar->codec_tag = 0; /* no fourcc */
if (vmd->vmd_header[811] & 0x80) {
- st->codec->channels = 2;
- st->codec->channel_layout = AV_CH_LAYOUT_STEREO;
+ st->codecpar->channels = 2;
+ st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
} else {
- st->codec->channels = 1;
- st->codec->channel_layout = AV_CH_LAYOUT_MONO;
+ st->codecpar->channels = 1;
+ st->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
}
- st->codec->sample_rate = vmd->sample_rate;
- st->codec->block_align = AV_RL16(&vmd->vmd_header[806]);
- if (st->codec->block_align & 0x8000) {
- st->codec->bits_per_coded_sample = 16;
- st->codec->block_align = -(st->codec->block_align - 0x10000);
+ st->codecpar->sample_rate = vmd->sample_rate;
+ st->codecpar->block_align = AV_RL16(&vmd->vmd_header[806]);
+ if (st->codecpar->block_align & 0x8000) {
+ st->codecpar->bits_per_coded_sample = 16;
+ st->codecpar->block_align = -(st->codecpar->block_align - 0x10000);
} else {
- st->codec->bits_per_coded_sample = 8;
+ st->codecpar->bits_per_coded_sample = 8;
}
- st->codec->bit_rate = st->codec->sample_rate *
- st->codec->bits_per_coded_sample * st->codec->channels;
+ st->codecpar->bit_rate = st->codecpar->sample_rate *
+ st->codecpar->bits_per_coded_sample * st->codecpar->channels;
/* calculate pts */
- num = st->codec->block_align;
- den = st->codec->sample_rate * st->codec->channels;
+ num = st->codecpar->block_align;
+ den = st->codecpar->sample_rate * st->codecpar->channels;
av_reduce(&num, &den, num, den, (1UL<<31)-1);
if (vst)
avpriv_set_pts_info(vst, 33, num, den);