1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00
FFmpeg/libavfilter
Muhammad Faiz 7fae0ea21d avfilter: take_samples: do not directly return frame when samples are skipped
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

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
(cherry picked from commit fc3a03fcf9cd7eafe7342e2508e6128888efa0bb)
2017-05-20 23:30:29 +07:00
..
2016-12-01 09:53:38 +01:00
2016-02-18 15:35:30 +01:00
2015-10-26 20:56:17 +01:00
2017-01-12 15:07:18 +01:00
2016-03-13 10:06:21 +01:00
2016-11-13 19:11:07 -06:00
2016-11-27 20:46:20 +01:00
2017-01-12 10:22:52 +01:00
2016-01-28 19:49:48 -08:00
2016-01-28 19:49:48 -08:00
2016-01-31 15:44:11 -08:00
2016-01-28 19:49:48 -08:00
2016-05-04 18:16:21 +02:00
2016-01-31 15:44:11 -08:00
2017-04-02 19:49:45 +02:00
2016-09-07 15:36:54 +02:00
2016-10-09 20:09:00 +02:00
2016-06-15 13:56:07 +02:00
2016-02-27 21:35:20 +01:00
2016-02-17 09:42:46 +01:00
2015-08-18 10:24:01 -04:00
2016-09-24 09:52:10 +02:00
2015-09-12 02:14:44 +00:00
2017-03-29 14:49:29 +02:00
2017-01-30 18:44:08 +01:00
2017-03-29 14:49:29 +02:00