Commit e0f17fed authored by Stefan Westerfeld's avatar Stefan Westerfeld

Avoid speed detection for ultra short input files to avoid errors.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 69400419
......@@ -497,6 +497,14 @@ get_best_clip_location (const WavData& in_data, double seconds, int candidates)
double
detect_speed (const WavData& in_data, bool print_results)
{
/* typically even for high strength we need at least a few seconds of audio
* in in_data for successful speed detection, but our algorithm won't work at
* all for very short input files
*/
double in_seconds = double (in_data.n_frames()) / in_data.sample_rate();
if (in_seconds < 0.25)
return 1;
ThreadPool thread_pool;
/* first pass: find approximation for speed */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment