Modifying data pointer when skipping samples may make it unaligned. Workaround for Ticket6349. This should fix the crash of ticket's testcase and a crash/regression with avxsynth (reported by Michael Niedermayer). Also change frame->nb_samples < max to frame->nb_samples <= max. This improves performance. Benchmark: ./ffmpeg -filter_complex "aevalsrc=0:n=1166,firequalizer=fixed=on" -f null null old: 25767 decicycles in take_samples, 1023 runs, 1 skips 25422 decicycles in take_samples, 2047 runs, 1 skips 25181 decicycles in take_samples, 4095 runs, 1 skips 24904 decicycles in take_samples, 8191 runs, 1 skips new: 550 decicycles in take_samples, 1024 runs, 0 skips 548 decicycles in take_samples, 2048 runs, 0 skips 545 decicycles in take_samples, 4096 runs, 0 skips 544 decicycles in take_samples, 8192 runs, 0 skips
Showing the changes to libavfilter/framequeue.h (1 of 3 files). Show all
Unified · Split
| @@ -100,6 +100,11 @@ typedef struct FFFrameQueue { · 99 unmodified lines | |||
| 100 | */ | 100 | */ |
| 101 | uint64_t total_samples_tail; | 101 | uint64_t total_samples_tail; |
| 102 | 102 | ||
| 103 | /** | ||
| 104 | * Indicate that samples are skipped | ||
| 105 | */ | ||
| 106 | int samples_skipped; | ||
| 107 | |||
| 103 | } FFFrameQueue; | 108 | } FFFrameQueue; |
| 104 | 109 | ||
| 105 | /** | 110 | /** |