]> git.sesse.net Git - vlc/commitdiff
PulseAudio: disable fix-rate when negotiating pass-through (refs #9309)
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 4 Sep 2013 18:36:36 +0000 (21:36 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 4 Sep 2013 18:37:11 +0000 (21:37 +0300)
API design bug in PulseAudio...

modules/audio_output/pulse.c

index 1fe79cce090ad040e44c75fdbe19b547029368d1..b477740c47ea30dce9a40e03d2ac35937f8b43ac 100644 (file)
@@ -794,12 +794,12 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
 
     /* Stream parameters */
-    const pa_stream_flags_t flags = sys->flags_force
-                                  | PA_STREAM_START_CORKED
-                                  | PA_STREAM_INTERPOLATE_TIMING
-                                  | PA_STREAM_NOT_MONOTONIC
-                                  | PA_STREAM_AUTO_TIMING_UPDATE
-                                  | PA_STREAM_FIX_RATE;
+    pa_stream_flags_t flags = sys->flags_force
+                            | PA_STREAM_START_CORKED
+                            | PA_STREAM_INTERPOLATE_TIMING
+                            | PA_STREAM_NOT_MONOTONIC
+                            | PA_STREAM_AUTO_TIMING_UPDATE
+                            | PA_STREAM_FIX_RATE;
 
     struct pa_buffer_attr attr;
     attr.maxlength = -1;
@@ -831,6 +831,12 @@ static int Start(audio_output_t *aout, audio_sample_format_t *restrict fmt)
         pa_format_info_set_channels(formatv[formatc], ss.channels);
         pa_format_info_set_channel_map(formatv[formatc], &map);
         formatc++;
+
+        /* FIX flags are only permitted for PCM, and there is no way to pass
+         * different flags for different formats... */
+        flags &= ~(PA_STREAM_FIX_FORMAT
+                 | PA_STREAM_FIX_RATE
+                 | PA_STREAM_FIX_CHANNELS);
     }
 
     /* Fallback to PCM */