[gnome-remote-desktop] rdp/rdpsnd: Don't prepare audio samples when volume data is invalid



commit 17c34d15d3fad6370b8a048b28da1ae22290923d
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Sat Sep 3 15:41:14 2022 +0200

    rdp/rdpsnd: Don't prepare audio samples when volume data is invalid
    
    An audio output stream can already submit audio samples to the audio
    playback instance, while its volume values might not be received yet.
    In such case, gnome-remote-desktop currently hits an assertion, that
    assumes that the amount of volume values is equal to 1, when the amount
    of volume values is lower than 2.
    
    To fix this assertion hit, assume that the volume of the stream is
    muted, when the amount of volume values is 0.
    As soon as the volume data is available, the audio output stream can
    submit the audio samples to the pending frames queue.
    
    Fixes: https://errors.ubuntu.com/problem/060bb232251f482381750964fdc92094bed5fe42

 src/grd-rdp-audio-playback.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/grd-rdp-audio-playback.c b/src/grd-rdp-audio-playback.c
index 0075afee..22b3f292 100644
--- a/src/grd-rdp-audio-playback.c
+++ b/src/grd-rdp-audio-playback.c
@@ -173,6 +173,11 @@ prepare_volume_data (GrdRdpAudioVolumeData *volume_data)
       for (i = 0; i < volume_data->n_volumes; ++i)
         volume_data->volumes[i] = 0.0f;
     }
+  else if (volume_data->n_volumes == 0)
+    {
+      for (i = 0; i < N_CHANNELS; ++i)
+        volume_data->volumes[i] = 0.0f;
+    }
   else if (N_CHANNELS > volume_data->n_volumes)
     {
       g_assert (N_CHANNELS == 2);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]