diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-08 21:27:01 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-08 21:27:01 +0000 |
| commit | 7339bd0457584dc8996a472ee7264a59a779c68e (patch) | |
| tree | f4283d575d21f0c1ca8c28c80ec068c5040f1d4a /src/lib | |
| parent | bb95f333f15ace7c032bb5b5761b512b6fe2e84e (diff) | |
Fix crash on analysing audio when we think the film is zero length.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/analyse_audio_job.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 41f918f34..de2632b0a 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -67,7 +67,7 @@ AnalyseAudioJob::run () decoders.audio->Audio.connect (bind (&AnalyseAudioJob::audio, this, _1)); int64_t total_audio_frames = video_frames_to_audio_frames (_film->length().get(), _film->audio_stream()->sample_rate(), _film->source_frame_rate()); - _samples_per_point = total_audio_frames / _num_points; + _samples_per_point = min (1, total_audio_frames / _num_points); _current.resize (_film->audio_stream()->channels ()); _analysis.reset (new AudioAnalysis (_film->audio_stream()->channels())); |
