[pulseaudio-commits] r2233 - in /branches/glitch-free/src/pulsecore: tagstruct.c tagstruct.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Apr 11 09:20:36 PDT 2008


Author: lennart
Date: Fri Apr 11 18:20:33 2008
New Revision: 2233

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2233&root=pulseaudio&view=rev
Log:
fix proplist serialization

Modified:
    branches/glitch-free/src/pulsecore/tagstruct.c
    branches/glitch-free/src/pulsecore/tagstruct.h

Modified: branches/glitch-free/src/pulsecore/tagstruct.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/tagstruct.c?rev=2233&root=pulseaudio&r1=2232&r2=2233&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/tagstruct.c (original)
+++ branches/glitch-free/src/pulsecore/tagstruct.c Fri Apr 11 18:20:33 2008
@@ -570,10 +570,11 @@
         return -1;
 
     saved_rindex = t->rindex;
+    t->rindex++;
 
     for (;;) {
         const char *k;
-        void *d;
+        const void *d;
         uint32_t length;
 
         if (pa_tagstruct_gets(t, &k) < 0)
@@ -588,17 +589,11 @@
         if (length > MAX_TAG_SIZE)
             goto fail;
 
-        d = pa_xmalloc(length);
-
-        if (pa_tagstruct_get_arbitrary(t, d, length) < 0)
+        if (pa_tagstruct_get_arbitrary(t, &d, length) < 0)
             goto fail;
 
-        if (pa_proplist_set(p, k, d, length) < 0) {
-            pa_xfree(d);
+        if (pa_proplist_set(p, k, d, length) < 0)
             goto fail;
-        }
-
-        pa_xfree(d);
     }
 
     return 0;

Modified: branches/glitch-free/src/pulsecore/tagstruct.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/tagstruct.h?rev=2233&root=pulseaudio&r1=2232&r2=2233&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/tagstruct.h (original)
+++ branches/glitch-free/src/pulsecore/tagstruct.h Fri Apr 11 18:20:33 2008
@@ -33,6 +33,9 @@
 #include <pulse/channelmap.h>
 #include <pulse/volume.h>
 #include <pulse/proplist.h>
+#include <pulse/gccmacro.h>
+
+#include <pulsecore/macro.h>
 
 typedef struct pa_tagstruct pa_tagstruct;
 




More information about the pulseaudio-commits mailing list