Mercurial > libavformat.hg
comparison wc3movie.c @ 462:b69898ffc92a libavformat
move time_base (pts_num/pts_den) from AVFormatContext -> AVStream
author | michael |
---|---|
date | Fri, 21 May 2004 20:43:21 +0000 |
parents | c152849ee643 |
children | 0fdc96c2f2fe |
comparison
equal
deleted
inserted
replaced
461:63540e5504f7 | 462:b69898ffc92a |
---|---|
231 | 231 |
232 /* initialize the decoder streams */ | 232 /* initialize the decoder streams */ |
233 st = av_new_stream(s, 0); | 233 st = av_new_stream(s, 0); |
234 if (!st) | 234 if (!st) |
235 return AVERROR_NOMEM; | 235 return AVERROR_NOMEM; |
236 av_set_pts_info(st, 33, 1, 90000); | |
236 wc3->video_stream_index = st->index; | 237 wc3->video_stream_index = st->index; |
237 st->codec.codec_type = CODEC_TYPE_VIDEO; | 238 st->codec.codec_type = CODEC_TYPE_VIDEO; |
238 st->codec.codec_id = CODEC_ID_XAN_WC3; | 239 st->codec.codec_id = CODEC_ID_XAN_WC3; |
239 st->codec.codec_tag = 0; /* no fourcc */ | 240 st->codec.codec_tag = 0; /* no fourcc */ |
240 st->codec.width = wc3->width; | 241 st->codec.width = wc3->width; |
244 st->codec.palctrl = &wc3->palette_control; | 245 st->codec.palctrl = &wc3->palette_control; |
245 | 246 |
246 st = av_new_stream(s, 0); | 247 st = av_new_stream(s, 0); |
247 if (!st) | 248 if (!st) |
248 return AVERROR_NOMEM; | 249 return AVERROR_NOMEM; |
250 av_set_pts_info(st, 33, 1, 90000); | |
249 wc3->audio_stream_index = st->index; | 251 wc3->audio_stream_index = st->index; |
250 st->codec.codec_type = CODEC_TYPE_AUDIO; | 252 st->codec.codec_type = CODEC_TYPE_AUDIO; |
251 st->codec.codec_id = CODEC_ID_PCM_S16LE; | 253 st->codec.codec_id = CODEC_ID_PCM_S16LE; |
252 st->codec.codec_tag = 1; | 254 st->codec.codec_tag = 1; |
253 st->codec.channels = WC3_AUDIO_CHANNELS; | 255 st->codec.channels = WC3_AUDIO_CHANNELS; |
254 st->codec.bits_per_sample = WC3_AUDIO_BITS; | 256 st->codec.bits_per_sample = WC3_AUDIO_BITS; |
255 st->codec.sample_rate = WC3_SAMPLE_RATE; | 257 st->codec.sample_rate = WC3_SAMPLE_RATE; |
256 st->codec.bit_rate = st->codec.channels * st->codec.sample_rate * | 258 st->codec.bit_rate = st->codec.channels * st->codec.sample_rate * |
257 st->codec.bits_per_sample; | 259 st->codec.bits_per_sample; |
258 st->codec.block_align = WC3_AUDIO_BITS * WC3_AUDIO_CHANNELS; | 260 st->codec.block_align = WC3_AUDIO_BITS * WC3_AUDIO_CHANNELS; |
259 | |
260 /* set the pts reference (1 pts = 1/90000) */ | |
261 s->pts_num = 1; | |
262 s->pts_den = 90000; | |
263 | 261 |
264 return 0; | 262 return 0; |
265 } | 263 } |
266 | 264 |
267 static int wc3_read_packet(AVFormatContext *s, | 265 static int wc3_read_packet(AVFormatContext *s, |