diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-07-17 22:24:36 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-07-17 22:24:36 +0000 |
commit | 01f4895c682a1752bf6d138ffb0628470e16b85a (patch) | |
tree | 56a3dfce270dad38b97c8f7ff288cc23cfac54da /libavformat/sierravmd.c | |
parent | 4c1a012e9ceb0840688c547625208e7c4b81624a (diff) | |
download | ffmpeg-01f4895c682a1752bf6d138ffb0628470e16b85a.tar.gz |
changing AVCodecContext codec -> *codec in AVStream so additions to AVCodecContext dont randomize AVStream and break binary compatibility
Originally committed as revision 4453 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/sierravmd.c')
-rw-r--r-- | libavformat/sierravmd.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 09b7a7491a..5f6005bca4 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -131,14 +131,14 @@ static int vmd_read_header(AVFormatContext *s, return AVERROR_NOMEM; av_set_pts_info(st, 33, 1, 90000); vmd->video_stream_index = st->index; - st->codec.codec_type = CODEC_TYPE_VIDEO; - st->codec.codec_id = CODEC_ID_VMDVIDEO; - st->codec.codec_tag = 0; /* no fourcc */ - st->codec.width = LE_16(&vmd->vmd_header[12]); - st->codec.height = LE_16(&vmd->vmd_header[14]); - st->codec.extradata_size = VMD_HEADER_SIZE; - st->codec.extradata = av_malloc(VMD_HEADER_SIZE); - memcpy(st->codec.extradata, vmd->vmd_header, VMD_HEADER_SIZE); + st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_id = CODEC_ID_VMDVIDEO; + st->codec->codec_tag = 0; /* no fourcc */ + st->codec->width = LE_16(&vmd->vmd_header[12]); + st->codec->height = LE_16(&vmd->vmd_header[14]); + st->codec->extradata_size = VMD_HEADER_SIZE; + st->codec->extradata = av_malloc(VMD_HEADER_SIZE); + memcpy(st->codec->extradata, vmd->vmd_header, VMD_HEADER_SIZE); /* if sample rate is 0, assume no audio */ vmd->sample_rate = LE_16(&vmd->vmd_header[804]); @@ -148,29 +148,29 @@ static int vmd_read_header(AVFormatContext *s, return AVERROR_NOMEM; av_set_pts_info(st, 33, 1, 90000); vmd->audio_stream_index = st->index; - st->codec.codec_type = CODEC_TYPE_AUDIO; - st->codec.codec_id = CODEC_ID_VMDAUDIO; - st->codec.codec_tag = 0; /* no codec tag */ - st->codec.channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1; - st->codec.sample_rate = vmd->sample_rate; - st->codec.block_align = vmd->audio_block_align = + st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_id = CODEC_ID_VMDAUDIO; + st->codec->codec_tag = 0; /* no codec tag */ + st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1; + st->codec->sample_rate = vmd->sample_rate; + st->codec->block_align = vmd->audio_block_align = LE_16(&vmd->vmd_header[806]); - if (st->codec.block_align & 0x8000) { - st->codec.bits_per_sample = 16; - st->codec.block_align = -(st->codec.block_align - 0x10000); + if (st->codec->block_align & 0x8000) { + st->codec->bits_per_sample = 16; + st->codec->block_align = -(st->codec->block_align - 0x10000); } else - st->codec.bits_per_sample = 16; -// st->codec.bits_per_sample = 8; - st->codec.bit_rate = st->codec.sample_rate * - st->codec.bits_per_sample * st->codec.channels; + st->codec->bits_per_sample = 16; +// st->codec->bits_per_sample = 8; + st->codec->bit_rate = st->codec->sample_rate * + st->codec->bits_per_sample * st->codec->channels; /* for calculating pts */ - vmd->audio_frame_divisor = st->codec.bits_per_sample / 8 / - st->codec.channels; + vmd->audio_frame_divisor = st->codec->bits_per_sample / 8 / + st->codec->channels; video_pts_inc = 90000; - video_pts_inc *= st->codec.block_align; - video_pts_inc /= st->codec.sample_rate; + video_pts_inc *= st->codec->block_align; + video_pts_inc /= st->codec->sample_rate; } else { /* if no audio, assume 10 frames/second */ video_pts_inc = 90000 / 10; |