]> code.delx.au - pulseaudio/commitdiff
stream: Fix sample spec initialisation for extended API
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 27 Mar 2012 19:31:32 +0000 (01:01 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Tue, 27 Mar 2012 19:56:07 +0000 (01:26 +0530)
This fixes pa_sample_spec init to use the correct API. Not doing so
triggers a valgrind warning as we call pa_sample_spec_valid() on this
later on, which checks the rate and channels fields. Thanks to RĂ©mi
Denis-Courmont for reporting this.

src/pulse/stream.c

index 6115cefb335757d3d18d57344513a55f9e814d06..39338c1d1b2eb762da5f96ac009e1b8facce9ac0 100644 (file)
@@ -112,7 +112,7 @@ static pa_stream *pa_stream_new_with_proplist_internal(
     if (ss)
         s->sample_spec = *ss;
     else
-        s->sample_spec.format = PA_SAMPLE_INVALID;
+        pa_sample_spec_init(&s->sample_spec);
 
     if (map)
         s->channel_map = *map;