mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
lavfi: make ff_framequeue_skip_samples() more useful.
Instead of just updating statistics and leaving the work to the call site, have it actually do the work. Also: skip the samples by updating the frame data pointers instead of moving the samples. More efficient and avoid writing into shared frames. Found-By: Muhammad Faiz <mfcc64@gmail.com>
This commit is contained in:
@@ -161,14 +161,13 @@ static inline void ff_framequeue_update_peeked(FFFrameQueue *fq, size_t idx)
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the sample count in the queue.
|
||||
* Skip samples from the first frame in the queue.
|
||||
*
|
||||
* This function must be used when the first frame was accessed using
|
||||
* ff_framequeue_peek() and samples were removed from it.
|
||||
* ff_framequeue_peek() and samples were consumed from it.
|
||||
* It adapts the data pointers and timestamps of the head frame to account
|
||||
* for the skipped samples.
|
||||
*/
|
||||
static inline void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t n)
|
||||
{
|
||||
fq->total_samples_tail += n;
|
||||
}
|
||||
void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base);
|
||||
|
||||
#endif /* AVFILTER_FRAMEQUEUE_H */
|
||||
|
||||
Reference in New Issue
Block a user