mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
add pa_ prefix to all identifiers.
fix downsampling/resampling add support for U8 samples git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@49 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
a8a5ab1c79
commit
e61c2dddb7
91 changed files with 1795 additions and 1643 deletions
22
src/packet.c
22
src/packet.c
|
|
@ -3,44 +3,44 @@
|
|||
|
||||
#include "packet.h"
|
||||
|
||||
struct packet* packet_new(size_t length) {
|
||||
struct packet *p;
|
||||
struct pa_packet* pa_packet_new(size_t length) {
|
||||
struct pa_packet *p;
|
||||
assert(length);
|
||||
p = malloc(sizeof(struct packet)+length);
|
||||
p = malloc(sizeof(struct pa_packet)+length);
|
||||
assert(p);
|
||||
|
||||
p->ref = 1;
|
||||
p->length = length;
|
||||
p->data = (uint8_t*) (p+1);
|
||||
p->type = PACKET_APPENDED;
|
||||
p->type = PA_PACKET_APPENDED;
|
||||
return p;
|
||||
}
|
||||
|
||||
struct packet* packet_new_dynamic(uint8_t* data, size_t length) {
|
||||
struct packet *p;
|
||||
struct pa_packet* pa_packet_new_dynamic(uint8_t* data, size_t length) {
|
||||
struct pa_packet *p;
|
||||
assert(data && length);
|
||||
p = malloc(sizeof(struct packet));
|
||||
p = malloc(sizeof(struct pa_packet));
|
||||
assert(p);
|
||||
|
||||
p->ref = 1;
|
||||
p->length = length;
|
||||
p->data = data;
|
||||
p->type = PACKET_DYNAMIC;
|
||||
p->type = PA_PACKET_DYNAMIC;
|
||||
return p;
|
||||
}
|
||||
|
||||
struct packet* packet_ref(struct packet *p) {
|
||||
struct pa_packet* pa_packet_ref(struct pa_packet *p) {
|
||||
assert(p && p->ref >= 1);
|
||||
p->ref++;
|
||||
return p;
|
||||
}
|
||||
|
||||
void packet_unref(struct packet *p) {
|
||||
void pa_packet_unref(struct pa_packet *p) {
|
||||
assert(p && p->ref >= 1);
|
||||
p->ref--;
|
||||
|
||||
if (p->ref == 0) {
|
||||
if (p->type == PACKET_DYNAMIC)
|
||||
if (p->type == PA_PACKET_DYNAMIC)
|
||||
free(p->data);
|
||||
free(p);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue