Mercurial > libavformat.hg
comparison mpegts.c @ 743:af4e24d6310c libavformat
switch to native time bases
author | michael |
---|---|
date | Sat, 30 Apr 2005 21:43:59 +0000 |
parents | 29a19aec26b2 |
children | 5f07cc45fd50 |
comparison
equal
deleted
inserted
replaced
742:21c1ae78f041 | 743:af4e24d6310c |
---|---|
1206 /* NOTE2: it is only the bitrate of the start of the stream */ | 1206 /* NOTE2: it is only the bitrate of the start of the stream */ |
1207 ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]); | 1207 ts->pcr_incr = (pcrs[1] - pcrs[0]) / (packet_count[1] - packet_count[0]); |
1208 ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0]; | 1208 ts->cur_pcr = pcrs[0] - ts->pcr_incr * packet_count[0]; |
1209 s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr; | 1209 s->bit_rate = (TS_PACKET_SIZE * 8) * 27e6 / ts->pcr_incr; |
1210 st->codec.bit_rate = s->bit_rate; | 1210 st->codec.bit_rate = s->bit_rate; |
1211 st->start_time = ts->cur_pcr * 1000000.0 / 27.0e6; | 1211 st->start_time = ts->cur_pcr; |
1212 #if 0 | 1212 #if 0 |
1213 printf("start=%0.3f pcr=%0.3f incr=%d\n", | 1213 printf("start=%0.3f pcr=%0.3f incr=%d\n", |
1214 st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr); | 1214 st->start_time / 1000000.0, pcrs[0] / 27e6, ts->pcr_incr); |
1215 #endif | 1215 #endif |
1216 } | 1216 } |