From 359d9c9221b327c7277c23734ec4d337d0cf3323 Mon Sep 17 00:00:00 2001 From: Patrick Linstruth Date: Tue, 9 Oct 2018 09:27:20 -0700 Subject: [PATCH] Eliminate INVALID_FUNC errors by not calling HPI_OutStreamSetTimeScale() on adapters that do not support this function --- rdhpi/rdhpiplaystream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rdhpi/rdhpiplaystream.cpp b/rdhpi/rdhpiplaystream.cpp index 6deadf0c..596af112 100644 --- a/rdhpi/rdhpiplaystream.cpp +++ b/rdhpi/rdhpiplaystream.cpp @@ -413,9 +413,11 @@ bool RDHPIPlayStream::play() return false; } if((!playing)&&(!is_paused)) { - LogHpi(HPI_OutStreamSetTimeScale(NULL,hpi_stream, + if(sound_card->haveTimescaling(card_number)) { + LogHpi(HPI_OutStreamSetTimeScale(NULL,hpi_stream, (uint16_t)((RD_TIMESCALE_DIVISOR/(double)play_speed)* HPI_OSTREAM_TIMESCALE_UNITS)),__LINE__); + } if(LogHpi(HPI_OutStreamGetInfoEx(NULL,hpi_stream, &state,&buffer_size,&data_to_play, &samples_played,&reserved),__LINE__)!=0) {