return the estimated time at which the current packet must be sent (in us) */
| 2211 | /* return the estimated time at which the current packet must be sent |
| 2212 | (in us) */ |
| 2213 | static int64_t get_packet_send_clock(HTTPContext *c) |
| 2214 | { |
| 2215 | int bytes_left, bytes_sent, frame_bytes; |
| 2216 | |
| 2217 | frame_bytes = c->cur_frame_bytes; |
| 2218 | if (frame_bytes <= 0) |
| 2219 | return c->cur_pts; |
| 2220 | else { |
| 2221 | bytes_left = c->buffer_end - c->buffer_ptr; |
| 2222 | bytes_sent = frame_bytes - bytes_left; |
| 2223 | return c->cur_pts + (c->cur_frame_duration * bytes_sent) / frame_bytes; |
| 2224 | } |
| 2225 | } |
| 2226 | |
| 2227 | |
| 2228 | static int http_prepare_data(HTTPContext *c) |