[pulseaudio-commits] r2529 - /trunk/src/pulsecore/protocol-native.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Sat Jun 14 14:33:22 PDT 2008
Author: lennart
Date: Sat Jun 14 23:33:21 2008
New Revision: 2529
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2529&root=pulseaudio&view=rev
Log:
avoid division by zero when informing user about unloaded lazy samples in the sample cache
Modified:
trunk/src/pulsecore/protocol-native.c
Modified: trunk/src/pulsecore/protocol-native.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/protocol-native.c?rev=2529&root=pulseaudio&r1=2528&r2=2529&view=diff
==============================================================================
--- trunk/src/pulsecore/protocol-native.c (original)
+++ trunk/src/pulsecore/protocol-native.c Sat Jun 14 23:33:21 2008
@@ -2566,12 +2566,15 @@
pa_assert(t);
pa_assert(e);
- fixup_sample_spec(c, &fixed_ss, &e->sample_spec);
+ if (e->memchunk.memblock)
+ fixup_sample_spec(c, &fixed_ss, &e->sample_spec);
+ else
+ memset(&fixed_ss, 0, sizeof(fixed_ss));
pa_tagstruct_putu32(t, e->index);
pa_tagstruct_puts(t, e->name);
pa_tagstruct_put_cvolume(t, &e->volume);
- pa_tagstruct_put_usec(t, pa_bytes_to_usec(e->memchunk.length, &e->sample_spec));
+ pa_tagstruct_put_usec(t, e->memchunk.memblock ? pa_bytes_to_usec(e->memchunk.length, &e->sample_spec) : NULL);
pa_tagstruct_put_sample_spec(t, &fixed_ss);
pa_tagstruct_put_channel_map(t, &e->channel_map);
pa_tagstruct_putu32(t, e->memchunk.length);
More information about the pulseaudio-commits
mailing list