Mercurial > libavformat.hg
comparison mpegts.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 | d42038d418a0 |
children | 696f41bc8784 |
comparison
equal
deleted
inserted
replaced
461:63540e5504f7 | 462:b69898ffc92a |
---|---|
766 } | 766 } |
767 break; | 767 break; |
768 } | 768 } |
769 st = av_new_stream(pes->stream, pes->pid); | 769 st = av_new_stream(pes->stream, pes->pid); |
770 if (st) { | 770 if (st) { |
771 av_set_pts_info(st, 60, 1, 27000000); | |
771 st->priv_data = pes; | 772 st->priv_data = pes; |
772 st->codec.codec_type = codec_type; | 773 st->codec.codec_type = codec_type; |
773 st->codec.codec_id = codec_id; | 774 st->codec.codec_id = codec_id; |
774 st->need_parsing = 1; | 775 st->need_parsing = 1; |
775 pes->st = st; | 776 pes->st = st; |
1163 int64_t pcrs[2], pcr_h; | 1164 int64_t pcrs[2], pcr_h; |
1164 int packet_count[2]; | 1165 int packet_count[2]; |
1165 uint8_t packet[TS_PACKET_SIZE]; | 1166 uint8_t packet[TS_PACKET_SIZE]; |
1166 | 1167 |
1167 /* only read packets */ | 1168 /* only read packets */ |
1168 | |
1169 s->pts_num = 1; | |
1170 s->pts_den = 27000000; | |
1171 | 1169 |
1172 do_pcr: | 1170 do_pcr: |
1173 st = av_new_stream(s, 0); | 1171 st = av_new_stream(s, 0); |
1174 if (!st) | 1172 if (!st) |
1175 goto fail; | 1173 goto fail; |
1174 av_set_pts_info(st, 60, 1, 27000000); | |
1176 st->codec.codec_type = CODEC_TYPE_DATA; | 1175 st->codec.codec_type = CODEC_TYPE_DATA; |
1177 st->codec.codec_id = CODEC_ID_MPEG2TS; | 1176 st->codec.codec_id = CODEC_ID_MPEG2TS; |
1178 | 1177 |
1179 /* we iterate until we find two PCRs to estimate the bitrate */ | 1178 /* we iterate until we find two PCRs to estimate the bitrate */ |
1180 pcr_pid = -1; | 1179 pcr_pid = -1; |