* Compute the end timestamp of a frame. If nb_samples is provided, consider * the frame to have this number of audio samples, otherwise use frame duration. */
| 116 | * the frame to have this number of audio samples, otherwise use frame duration. |
| 117 | */ |
| 118 | static int64_t frame_end(const SyncQueue *sq, SyncQueueFrame frame, int nb_samples) |
| 119 | { |
| 120 | if (nb_samples) { |
| 121 | int64_t d = av_rescale_q(nb_samples, (AVRational){ 1, frame.f->sample_rate}, |
| 122 | frame.f->time_base); |
| 123 | return frame.f->pts + d; |
| 124 | } |
| 125 | |
| 126 | return (sq->type == SYNC_QUEUE_PACKETS) ? |
| 127 | frame.p->pts + frame.p->duration : |
| 128 | frame.f->pts + frame.f->duration; |
| 129 | } |
| 130 | |
| 131 | static int frame_samples(const SyncQueue *sq, SyncQueueFrame frame) |
| 132 | { |
no test coverage detected