[vlc-commits] PulseAudio: disable fix-rate when negotiating pass-through (refs #9309)

Rémi Denis-Courmont git at videolan.org
Wed Sep 4 20:42:36 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Sep  4 21:36:36 2013 +0300| [a3e575faf74d75076a3543f847e65a174aa94e6c] | committer: Rémi Denis-Courmont

PulseAudio: disable fix-rate when negotiating pass-through (refs #9309)

API design bug in PulseAudio...

(cherry picked from commit 2ff2139198ffec4f6184c9d1c7efe71dcf7fae11)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=a3e575faf74d75076a3543f847e65a174aa94e6c
---

 modules/audio_output/pulse.c |   18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/modules/audio_output/pulse.c b/modules/audio_output/pulse.c
index 59a4840..657c50e 100644
--- a/modules/audio_output/pulse.c
+++ b/modules/audio_output/pulse.c
@@ -801,12 +801,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;
@@ -839,6 +839,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 */



More information about the vlc-commits mailing list