[pulseaudio] 01/01: Add tagstruct copy method

David Henningsson diwic-guest at moszumanska.debian.org
Thu Aug 27 17:11:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

diwic-guest pushed a commit to branch ubuntu
in repository pulseaudio.

commit 3560cafb03fc62745874077fb1153ec8d0cc59ac
Author: David Henningsson <david.henningsson at canonical.com>
Date:   Thu Aug 27 15:27:16 2015 +0200

    Add tagstruct copy method
    
    Originally by Wim Taymans, backported by David Henningsson
---
 src/pulsecore/tagstruct.c | 14 ++++++++++++++
 src/pulsecore/tagstruct.h |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/pulsecore/tagstruct.c b/src/pulsecore/tagstruct.c
index 63134f9..5db93b2 100644
--- a/src/pulsecore/tagstruct.c
+++ b/src/pulsecore/tagstruct.c
@@ -83,6 +83,20 @@ uint8_t* pa_tagstruct_free_data(pa_tagstruct*t, size_t *l) {
     return p;
 }
 
+pa_tagstruct *pa_tagstruct_copy(pa_tagstruct*t) {
+    pa_tagstruct*tc;
+
+    if (!(tc = pa_flist_pop(PA_STATIC_FLIST_GET(tagstructs))))
+        tc = pa_xnew(pa_tagstruct, 1);
+    tc->data = pa_xmemdup(t->data, t->length);
+    tc->allocated = t->length;
+    tc->length = t->length;
+    tc->rindex = 0;
+    tc->dynamic = true;
+
+    return tc;
+}
+
 static void extend(pa_tagstruct*t, size_t l) {
     pa_assert(t);
     pa_assert(t->dynamic);
diff --git a/src/pulsecore/tagstruct.h b/src/pulsecore/tagstruct.h
index 6319ee9..55f1ba4 100644
--- a/src/pulsecore/tagstruct.h
+++ b/src/pulsecore/tagstruct.h
@@ -64,6 +64,8 @@ pa_tagstruct *pa_tagstruct_new(const uint8_t* data, size_t length);
 void pa_tagstruct_free(pa_tagstruct*t);
 uint8_t* pa_tagstruct_free_data(pa_tagstruct*t, size_t *l);
 
+pa_tagstruct *pa_tagstruct_copy(pa_tagstruct*t);
+
 int pa_tagstruct_eof(pa_tagstruct*t);
 const uint8_t* pa_tagstruct_data(pa_tagstruct*t, size_t *l);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-pulseaudio/pulseaudio.git



More information about the pkg-pulseaudio-devel mailing list