[pulseaudio-commits] r2159 - in /branches/prepare-0.9.10/src: modules/ pulse/ pulsecore/

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Mar 27 16:29:33 PDT 2008


Author: lennart
Date: Fri Mar 28 00:29:32 2008
New Revision: 2159

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2159&root=pulseaudio&view=rev
Log:
merge r2105 from trunk

Modified:
    branches/prepare-0.9.10/src/modules/alsa-util.c
    branches/prepare-0.9.10/src/modules/module-combine.c
    branches/prepare-0.9.10/src/modules/module-jack-sink.c
    branches/prepare-0.9.10/src/modules/module-jack-source.c
    branches/prepare-0.9.10/src/modules/module-zeroconf-discover.c
    branches/prepare-0.9.10/src/pulse/stream.c
    branches/prepare-0.9.10/src/pulsecore/core-scache.c
    branches/prepare-0.9.10/src/pulsecore/resampler.c
    branches/prepare-0.9.10/src/pulsecore/sink-input.c
    branches/prepare-0.9.10/src/pulsecore/sink.c
    branches/prepare-0.9.10/src/pulsecore/sound-file.c
    branches/prepare-0.9.10/src/pulsecore/source-output.c
    branches/prepare-0.9.10/src/pulsecore/source.c

Modified: branches/prepare-0.9.10/src/modules/alsa-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/alsa-util.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/alsa-util.c (original)
+++ branches/prepare-0.9.10/src/modules/alsa-util.c Fri Mar 28 00:29:32 2008
@@ -615,8 +615,10 @@
 
         *dev = d;
 
-        if (ss->channels != map->channels)
+        if (ss->channels != map->channels) {
+            pa_assert_se(pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_AUX));
             pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_ALSA);
+        }
 
         return pcm_handle;
     }

Modified: branches/prepare-0.9.10/src/modules/module-combine.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/module-combine.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/module-combine.c (original)
+++ branches/prepare-0.9.10/src/modules/module-combine.c Fri Mar 28 00:29:32 2008
@@ -988,8 +988,10 @@
 
     if (master_sink && ss.channels == master_sink->sample_spec.channels)
         map = master_sink->channel_map;
-    else
+    else {
+        pa_assert_se(pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_AUX));
         pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_DEFAULT);
+    }
 
     if ((pa_modargs_get_channel_map(ma, NULL, &map) < 0)) {
         pa_log("Invalid channel map.");

Modified: branches/prepare-0.9.10/src/modules/module-jack-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/module-jack-sink.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/module-jack-sink.c (original)
+++ branches/prepare-0.9.10/src/modules/module-jack-sink.c Fri Mar 28 00:29:32 2008
@@ -333,6 +333,7 @@
         goto fail;
     }
 
+    pa_assert_se(pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_AUX));
     pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_ALSA);
     if (pa_modargs_get_channel_map(ma, NULL, &map) < 0 || map.channels != channels) {
         pa_log("Failed to parse channel_map= argument.");

Modified: branches/prepare-0.9.10/src/modules/module-jack-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/module-jack-source.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/module-jack-source.c (original)
+++ branches/prepare-0.9.10/src/modules/module-jack-source.c Fri Mar 28 00:29:32 2008
@@ -304,6 +304,7 @@
         goto fail;
     }
 
+    pa_assert_se(pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_AUX));
     pa_channel_map_init_auto(&map, channels, PA_CHANNEL_MAP_ALSA);
     if (pa_modargs_get_channel_map(ma, NULL, &map) < 0 || map.channels != channels) {
         pa_log("failed to parse channel_map= argument.");

Modified: branches/prepare-0.9.10/src/modules/module-zeroconf-discover.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/modules/module-zeroconf-discover.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/modules/module-zeroconf-discover.c (original)
+++ branches/prepare-0.9.10/src/modules/module-zeroconf-discover.c Fri Mar 28 00:29:32 2008
@@ -164,6 +164,7 @@
         pa_module *m;
 
         ss = u->core->default_sample_spec;
+        pa_assert_se(pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_AUX));
         pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
 
         for (l = txt; l; l = l->next) {
@@ -189,8 +190,10 @@
             avahi_free(value);
         }
 
-        if (!channel_map_set && cm.channels != ss.channels)
+        if (!channel_map_set && cm.channels != ss.channels) {
+            pa_assert_se(pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_AUX));
             pa_channel_map_init_auto(&cm, ss.channels, PA_CHANNEL_MAP_DEFAULT);
+        }
 
         if (!pa_sample_spec_valid(&ss)) {
             pa_log("Service '%s' contains an invalid sample specification.", name);

Modified: branches/prepare-0.9.10/src/pulse/stream.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulse/stream.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulse/stream.c (original)
+++ branches/prepare-0.9.10/src/pulse/stream.c Fri Mar 28 00:29:32 2008
@@ -46,6 +46,7 @@
 pa_stream *pa_stream_new(pa_context *c, const char *name, const pa_sample_spec *ss, const pa_channel_map *map) {
     pa_stream *s;
     int i;
+    pa_channel_map tmap;
 
     pa_assert(c);
     pa_assert(PA_REFCNT_VALUE(c) >= 1);
@@ -53,6 +54,9 @@
     PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
     PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 12 || (ss->format != PA_SAMPLE_S32LE || ss->format != PA_SAMPLE_S32NE), PA_ERR_NOTSUPPORTED);
     PA_CHECK_VALIDITY_RETURN_NULL(c, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID);
+
+    if (!map)
+        PA_CHECK_VALIDITY_RETURN_NULL(c, map = pa_channel_map_init_auto(&tmap, ss->channels, PA_CHANNEL_MAP_DEFAULT), PA_ERR_INVALID);
 
     s = pa_xnew(pa_stream, 1);
     PA_REFCNT_INIT(s);
@@ -81,12 +85,8 @@
     s->direction = PA_STREAM_NODIRECTION;
     s->name = pa_xstrdup(name);
     s->sample_spec = *ss;
+    s->channel_map = *map;
     s->flags = 0;
-
-    if (map)
-        s->channel_map = *map;
-    else
-        pa_channel_map_init_auto(&s->channel_map, ss->channels, PA_CHANNEL_MAP_DEFAULT);
 
     s->channel = 0;
     s->channel_valid = 0;

Modified: branches/prepare-0.9.10/src/pulsecore/core-scache.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/core-scache.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/core-scache.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/core-scache.c Fri Mar 28 00:29:32 2008
@@ -145,19 +145,28 @@
 int pa_scache_add_item(pa_core *c, const char *name, const pa_sample_spec *ss, const pa_channel_map *map, const pa_memchunk *chunk, uint32_t *idx) {
     pa_scache_entry *e;
     char st[PA_SAMPLE_SPEC_SNPRINT_MAX];
-
-    pa_assert(c);
-    pa_assert(name);
+    pa_channel_map tmap;
+
+    pa_assert(c);
+    pa_assert(name);
+    pa_assert(!ss || pa_sample_spec_valid(ss));
+    pa_assert(!map || (pa_channel_map_valid(map) && ss && ss->channels == map->channels));
+
+    if (ss && !map)
+        if (!(map = pa_channel_map_init_auto(&tmap, ss->channels, PA_CHANNEL_MAP_DEFAULT)))
+            return -1;
 
     if (chunk && chunk->length > PA_SCACHE_ENTRY_SIZE_MAX)
         return -1;
 
     if (!(e = scache_add_item(c, name)))
         return -1;
+
+    memset(&e->sample_spec, 0, sizeof(e->sample_spec));
+    pa_channel_map_init(&e->channel_map);
 
     if (ss) {
         e->sample_spec = *ss;
-        pa_channel_map_init_auto(&e->channel_map, ss->channels, PA_CHANNEL_MAP_DEFAULT);
         e->volume.channels = e->sample_spec.channels;
     }
 

Modified: branches/prepare-0.9.10/src/pulsecore/resampler.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/resampler.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/resampler.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/resampler.c Fri Mar 28 00:29:32 2008
@@ -215,13 +215,13 @@
 
     if (am)
         r->i_cm = *am;
-    else
-        pa_channel_map_init_auto(&r->i_cm, r->i_ss.channels, PA_CHANNEL_MAP_DEFAULT);
+    else if (!pa_channel_map_init_auto(&r->i_cm, r->i_ss.channels, PA_CHANNEL_MAP_DEFAULT))
+        goto fail;
 
     if (bm)
         r->o_cm = *bm;
-    else
-        pa_channel_map_init_auto(&r->o_cm, r->o_ss.channels, PA_CHANNEL_MAP_DEFAULT);
+    else if (!pa_channel_map_init_auto(&r->o_cm, r->o_ss.channels, PA_CHANNEL_MAP_DEFAULT))
+        goto fail;
 
     r->i_fz = pa_frame_size(a);
     r->o_fz = pa_frame_size(b);

Modified: branches/prepare-0.9.10/src/pulsecore/sink-input.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/sink-input.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/sink-input.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/sink-input.c Fri Mar 28 00:29:32 2008
@@ -120,7 +120,7 @@
         if (data->sink->channel_map.channels == data->sample_spec.channels)
             data->channel_map = data->sink->channel_map;
         else
-            pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
+            pa_return_null_if_fail(pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT));
     }
 
     pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));

Modified: branches/prepare-0.9.10/src/pulsecore/sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/sink.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/sink.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/sink.c Fri Mar 28 00:29:32 2008
@@ -73,7 +73,7 @@
     pa_return_null_if_fail(pa_sample_spec_valid(spec));
 
     if (!map)
-        map = pa_channel_map_init_auto(&tmap, spec->channels, PA_CHANNEL_MAP_DEFAULT);
+        pa_return_null_if_fail((map = pa_channel_map_init_auto(&tmap, spec->channels, PA_CHANNEL_MAP_DEFAULT)));
 
     pa_return_null_if_fail(map && pa_channel_map_valid(map));
     pa_return_null_if_fail(map->channels == spec->channels);

Modified: branches/prepare-0.9.10/src/pulsecore/sound-file.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/sound-file.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/sound-file.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/sound-file.c Fri Mar 28 00:29:32 2008
@@ -119,7 +119,10 @@
     }
 
     if (map)
-        pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_DEFAULT);
+        if (!pa_channel_map_init_auto(map, ss->channels, PA_CHANNEL_MAP_DEFAULT)) {
+            pa_log("Unsupported channel map in file %s", fname);
+            goto finish;
+        }
 
     if ((l = pa_frame_size(ss) * sfinfo.frames) > PA_SCACHE_ENTRY_SIZE_MAX) {
         pa_log("File too large");

Modified: branches/prepare-0.9.10/src/pulsecore/source-output.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/source-output.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/source-output.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/source-output.c Fri Mar 28 00:29:32 2008
@@ -97,7 +97,7 @@
         if (data->source->channel_map.channels == data->sample_spec.channels)
             data->channel_map = data->source->channel_map;
         else
-            pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
+            pa_return_null_if_fail(pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT));
     }
 
     pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));

Modified: branches/prepare-0.9.10/src/pulsecore/source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/prepare-0.9.10/src/pulsecore/source.c?rev=2159&root=pulseaudio&r1=2158&r2=2159&view=diff
==============================================================================
--- branches/prepare-0.9.10/src/pulsecore/source.c (original)
+++ branches/prepare-0.9.10/src/pulsecore/source.c Fri Mar 28 00:29:32 2008
@@ -64,7 +64,7 @@
     pa_return_null_if_fail(pa_sample_spec_valid(spec));
 
     if (!map)
-        map = pa_channel_map_init_auto(&tmap, spec->channels, PA_CHANNEL_MAP_DEFAULT);
+        pa_return_null_if_fail(map = pa_channel_map_init_auto(&tmap, spec->channels, PA_CHANNEL_MAP_DEFAULT));
 
     pa_return_null_if_fail(map && pa_channel_map_valid(map));
     pa_return_null_if_fail(map->channels == spec->channels);




More information about the pulseaudio-commits mailing list