Skip to content

Commit

Permalink
check also rubberband major api version
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Nov 19, 2022
1 parent 769cf9d commit 9303354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/rubberband/filter_rbpitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int rbpitch_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *
delete s;
// Create a rubberband instance
RubberBandStretcher::Options options = RubberBandStretcher::OptionProcessRealTime;
#if RUBBERBAND_API_MINOR_VERSION >= 7
#if RUBBERBAND_API_MAJOR_VERSION >= 2 && RUBBERBAND_API_MINOR_VERSION >= 7
// Use the higher quality engine if available.
options |= RubberBandStretcher::OptionEngineFiner;
#endif
Expand All @@ -116,7 +116,7 @@ static int rbpitch_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *
if( pitchscale >= 0.5 && pitchscale <= 2.0 )
{
// Pitch adjustment < 200%
#if RUBBERBAND_API_MINOR_VERSION < 7
#if RUBBERBAND_API_MAJOR_VERSION <= 2 && RUBBERBAND_API_MINOR_VERSION < 7
s->setPitchOption(RubberBandStretcher::OptionPitchHighQuality);
#endif
s->setTransientsOption(RubberBandStretcher::OptionTransientsCrisp);
Expand All @@ -126,7 +126,7 @@ static int rbpitch_get_audio( mlt_frame frame, void **buffer, mlt_audio_format *
// Pitch adjustment > 200%
// "HighConsistency" and "Smooth" options help to avoid large memory
// consumption and crashes that can occur for large pitch adjustments.
#if RUBBERBAND_API_MINOR_VERSION < 7
#if RUBBERBAND_API_MAJOR_VERSION <= 2 && RUBBERBAND_API_MINOR_VERSION < 7
s->setPitchOption(RubberBandStretcher::OptionPitchHighConsistency);
#endif
s->setTransientsOption(RubberBandStretcher::OptionTransientsSmooth);
Expand Down

0 comments on commit 9303354

Please sign in to comment.