History

lavfi/atempo: avoid asendcmd assertion failure

Check for zeros equal to the total samples early, because in that case we would already be leaving the first few frames out. Fixes trac ticket #10692

Rajiv Harlalka committed 2 years ago

Commit 47009251 parent 89969451 file · +9 −9Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_atempo.c+9−9
@@ -531,21 +531,21 @@ static int yae_load_frag(ATempoContext *atempo, · 530 unmodified lines
531531 dst = frag->data;
532532
533533 start = atempo->position[0] - atempo->size;
534− zeros = 0;
535534
536− if (frag->position[0] < start) {
537− // what we don't have we substitute with zeros:
538− zeros = FFMIN(start - frag->position[0], (int64_t)nsamples);
539− av_assert0(zeros != nsamples);
540−
541− memset(dst, 0, zeros * atempo->stride);
542− dst += zeros * atempo->stride;
543− }
535+ // what we don't have we substitute with zeros:
536+ zeros =
537+ frag->position[0] < start ?
538+ FFMIN(start - frag->position[0], (int64_t)nsamples) : 0;
544539
545540 if (zeros == nsamples) {
546541 return 0;
547542 }
548543
544+ if (frag->position[0] < start) {
545+ memset(dst, 0, zeros * atempo->stride);
546+ dst += zeros * atempo->stride;
547+ }
548+
549549 // get the remaining data from the ring buffer:
550550 na = (atempo->head < atempo->tail ?
551551 atempo->tail - atempo->head :

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t