summaryrefslogtreecommitdiff
path: root/fftools/sync_queue.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-14 11:12:22 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-19 21:12:03 +0200
commit9a44e0335c0b0ba54ec854e2579f9bb7237032f5 (patch)
tree7198e0e8dc10946642bfcfd2298fc5beeb8b9e5b /fftools/sync_queue.c
parentb088d59347ed24c9346d8bc1c81ee09637fbd7ec (diff)
downloadffmpeg-9a44e0335c0b0ba54ec854e2579f9bb7237032f5.tar.gz
fftools/sync_queue: update audio frame duration when re-chunking
Diffstat (limited to 'fftools/sync_queue.c')
-rw-r--r--fftools/sync_queue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fftools/sync_queue.c b/fftools/sync_queue.c
index 42a6b89b79..a7aac04047 100644
--- a/fftools/sync_queue.c
+++ b/fftools/sync_queue.c
@@ -431,7 +431,7 @@ static int receive_samples(SyncQueue *sq, SyncQueueStream *st,
offset_audio(src.f, nb_samples);
st->samples_queued -= nb_samples;
- return 0;
+ goto finish;
}
// otherwise allocate a new frame and copy the data
@@ -474,6 +474,10 @@ static int receive_samples(SyncQueue *sq, SyncQueueStream *st,
dst->nb_samples += to_copy;
}
+finish:
+ dst->duration = av_rescale_q(nb_samples, (AVRational){ 1, dst->sample_rate },
+ dst->time_base);
+
return 0;
fail: