aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index e0bdb6eb4..934c7d811 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -35,7 +35,11 @@ void decoder_initialized(struct decoder * decoder,
bool seekable, float total_time)
{
assert(dc.state == DECODE_STATE_START);
+ assert(decoder != NULL);
+ assert(!decoder->stream_tag_sent);
+ assert(!decoder->seeking);
assert(audio_format != NULL);
+ assert(audio_format_defined(audio_format));
pcm_convert_init(&decoder->conv_state);
@@ -96,6 +100,8 @@ size_t decoder_read(struct decoder *decoder,
{
size_t nbytes;
+ assert(dc.state == DECODE_STATE_START ||
+ dc.state == DECODE_STATE_DECODE);
assert(is != NULL);
assert(buffer != NULL);
@@ -175,6 +181,8 @@ decoder_data(struct decoder *decoder,
size_t nbytes;
char *data;
+ assert(dc.state == DECODE_STATE_DECODE);
+
if (is != NULL && !decoder->stream_tag_sent) {
const struct tag *src;
struct tag *tag1, *tag2;
@@ -254,6 +262,8 @@ decoder_tag(mpd_unused struct decoder *decoder, struct input_stream *is,
{
struct tag *tag2 = is != NULL ? tag_add_stream_tags(tag, is) : NULL;
+ assert(dc.state == DECODE_STATE_DECODE);
+
if (tag2 != NULL)
tag = tag2;