comparison ape.c @ 5566:28094e9bd013 libavformat

Set start_time and duration in AVStream instead of AVFormatContext for formats with only one stream; the AVFormatContext values will be derived from the AVStream and this helps in calculating stream bitrate.
author conrad
date Thu, 21 Jan 2010 09:47:02 +0000
parents 6c0318c8a127
children 134741dc8327
comparison
equal deleted inserted replaced
5565:befe2f0f9a00 5566:28094e9bd013
308 st->codec->sample_rate = ape->samplerate; 308 st->codec->sample_rate = ape->samplerate;
309 st->codec->bits_per_coded_sample = ape->bps; 309 st->codec->bits_per_coded_sample = ape->bps;
310 st->codec->frame_size = MAC_SUBFRAME_SIZE; 310 st->codec->frame_size = MAC_SUBFRAME_SIZE;
311 311
312 st->nb_frames = ape->totalframes; 312 st->nb_frames = ape->totalframes;
313 s->start_time = 0; 313 st->start_time = 0;
314 s->duration = (int64_t) total_blocks * AV_TIME_BASE / ape->samplerate; 314 st->duration = total_blocks / MAC_SUBFRAME_SIZE;
315 av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate); 315 av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
316 316
317 st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE); 317 st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
318 st->codec->extradata_size = APE_EXTRADATA_SIZE; 318 st->codec->extradata_size = APE_EXTRADATA_SIZE;
319 AV_WL16(st->codec->extradata + 0, ape->fileversion); 319 AV_WL16(st->codec->extradata + 0, ape->fileversion);