Mercurial > libavformat.hg
comparison rtpenc.c @ 3500:102f7d89c2c8 libavformat
Remove improper usage of AV_TIME_BASE_Q
author | lucabe |
---|---|
date | Wed, 25 Jun 2008 11:55:57 +0000 |
parents | 7a0230981402 |
children | 26f05fd01fd0 |
comparison
equal
deleted
inserted
replaced
3499:e54614e83ba4 | 3500:102f7d89c2c8 |
---|---|
79 s->max_frames_per_packet = av_rescale_rnd(s1->max_delay, st->codec->sample_rate, AV_TIME_BASE * st->codec->frame_size, AV_ROUND_DOWN); | 79 s->max_frames_per_packet = av_rescale_rnd(s1->max_delay, st->codec->sample_rate, AV_TIME_BASE * st->codec->frame_size, AV_ROUND_DOWN); |
80 } | 80 } |
81 } | 81 } |
82 if (st->codec->codec_type == CODEC_TYPE_VIDEO) { | 82 if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
83 /* FIXME: We should round down here... */ | 83 /* FIXME: We should round down here... */ |
84 s->max_frames_per_packet = av_rescale_q(s1->max_delay, AV_TIME_BASE_Q, st->codec->time_base); | 84 s->max_frames_per_packet = av_rescale_q(s1->max_delay, (AVRational){1, 1000000}, st->codec->time_base); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 av_set_pts_info(st, 32, 1, 90000); | 88 av_set_pts_info(st, 32, 1, 90000); |
89 switch(st->codec->codec_id) { | 89 switch(st->codec->codec_id) { |
124 printf("RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp); | 124 printf("RTCP: %02x %"PRIx64" %x\n", s->payload_type, ntp_time, s->timestamp); |
125 #endif | 125 #endif |
126 | 126 |
127 if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) s->first_rtcp_ntp_time = ntp_time; | 127 if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE) s->first_rtcp_ntp_time = ntp_time; |
128 s->last_rtcp_ntp_time = ntp_time; | 128 s->last_rtcp_ntp_time = ntp_time; |
129 rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, AV_TIME_BASE_Q, | 129 rtp_ts = av_rescale_q(ntp_time - s->first_rtcp_ntp_time, (AVRational){1, 1000000}, |
130 s1->streams[0]->time_base) + s->base_timestamp; | 130 s1->streams[0]->time_base) + s->base_timestamp; |
131 put_byte(s1->pb, (RTP_VERSION << 6)); | 131 put_byte(s1->pb, (RTP_VERSION << 6)); |
132 put_byte(s1->pb, 200); | 132 put_byte(s1->pb, 200); |
133 put_be16(s1->pb, 6); /* length in words - 1 */ | 133 put_be16(s1->pb, 6); /* length in words - 1 */ |
134 put_be32(s1->pb, s->ssrc); | 134 put_be32(s1->pb, s->ssrc); |