pipewire/src/modules/module-protocol-pulse/sample.c
Barnabás Pőcze 934ab3036e treewide: use SPDX tags to specify copyright information
SPDX tags make the licensing information easy to understand and clear,
and they are machine parseable.

See https://spdx.dev for more information.
2023-02-16 10:54:48 +00:00

30 lines
645 B
C

/* PipeWire */
/* SPDX-FileCopyrightText: Copyright © 2020 Wim Taymans */
/* SPDX-License-Identifier: MIT */
#include <stdlib.h>
#include <pipewire/log.h>
#include <pipewire/map.h>
#include <pipewire/properties.h>
#include "internal.h"
#include "log.h"
#include "sample.h"
void sample_free(struct sample *sample)
{
struct impl * const impl = sample->impl;
pw_log_info("free sample id:%u name:%s", sample->index, sample->name);
impl->stat.sample_cache -= sample->length;
if (sample->index != SPA_ID_INVALID)
pw_map_remove(&impl->samples, sample->index);
pw_properties_free(sample->props);
free(sample->buffer);
free(sample);
}