[vlc-commits] aout: change rate argument
Thomas Guillem
git at videolan.org
Fri Feb 15 16:38:06 CET 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb 15 15:00:23 2019 +0100| [b36e69b7726e89234c2577d59a5ca6450db66e42] | committer: Thomas Guillem
aout: change rate argument
Inverse it.
Before, the float rate value for a 4x speed was 0.25f. Now, for a 4x speed, the
float value will be 4.f.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b36e69b7726e89234c2577d59a5ca6450db66e42
---
src/audio_output/dec.c | 2 +-
src/audio_output/filters.c | 2 +-
src/input/decoder.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 104d5cca82..4d87c2a462 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -253,7 +253,7 @@ static void aout_DecSynchronize(audio_output_t *aout, vlc_tick_t dec_pts)
* where supported. The other alternative is to flush the buffers
* completely. */
if (drift > (owner->sync.discontinuity ? 0
- : lroundf(+3 * AOUT_MAX_PTS_DELAY * rate)))
+ : lroundf(+3 * AOUT_MAX_PTS_DELAY / rate)))
{
if (!owner->sync.discontinuity)
msg_Warn (aout, "playback way too late (%"PRId64"): "
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index 504257042b..de714916e9 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -685,7 +685,7 @@ block_t *aout_FiltersPlay(aout_filters_t *filters, block_t *block, float rate)
/* Override input rate */
nominal_rate = rate_filter->fmt_in.audio.i_rate;
- rate_filter->fmt_in.audio.i_rate = lroundf(nominal_rate / rate);
+ rate_filter->fmt_in.audio.i_rate = lroundf(nominal_rate * rate);
}
block = aout_FiltersPipelinePlay (filters->tab, filters->count, block);
diff --git a/src/input/decoder.c b/src/input/decoder.c
index bde6b90898..89af5a5d31 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1630,7 +1630,7 @@ static void OutputChangeRate( decoder_t *p_dec, float rate )
break;
case AUDIO_ES:
if( p_owner->p_aout != NULL )
- aout_DecChangeRate( p_owner->p_aout, 1 / rate );
+ aout_DecChangeRate( p_owner->p_aout, rate );
break;
case SPU_ES:
break;
More information about the vlc-commits
mailing list