Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/hound_ctx.c

    r541eb67 rdf13836  
    3535 */
    3636
     37#include <malloc.h>
    3738#include <macros.h>
    3839#include <errno.h>
    39 #include <stdlib.h>
    4040#include <str_error.h>
    4141
     
    340340
    341341        pcm_format_silence(data, size, &stream->format);
    342         const size_t ret =
     342        const int ret =
    343343            audio_pipe_mix_data(&stream->fifo, data, size, &stream->format);
    344344        fibril_mutex_unlock(&stream->guard);
    345         if (ret > 0) {
     345        if (ret == EOK)
    346346                fibril_condvar_signal(&stream->change);
    347                 return EOK;
    348         }
    349         return EEMPTY;
     347        return ret;
    350348}
    351349
     
    356354 * @param size Size of the @p data buffer.
    357355 * @param format Destination data format.
    358  * @return Size of the destination buffer touch with stream's data.
    359  */
    360 size_t hound_ctx_stream_add_self(hound_ctx_stream_t *stream, void *data,
     356 * @return Size of the destination buffer touch with stream's data,
     357 *         error code on failure.
     358 */
     359ssize_t hound_ctx_stream_add_self(hound_ctx_stream_t *stream, void *data,
    361360    size_t size, const pcm_format_t *f)
    362361{
    363362        assert(stream);
    364363        fibril_mutex_lock(&stream->guard);
    365         const size_t ret = audio_pipe_mix_data(&stream->fifo, data, size, f);
     364        const int ret = audio_pipe_mix_data(&stream->fifo, data, size, f);
    366365        fibril_condvar_signal(&stream->change);
    367366        fibril_mutex_unlock(&stream->guard);
     
    458457        list_foreach(sink->connections, source_link, connection_t, conn) {
    459458                /* This should not trigger data update on the source */
    460                 connection_add_source_data(
     459                const size_t copied = connection_add_source_data(
    461460                    conn, buffer, bsize, sink->format);
     461                if (copied != bsize)
     462                        log_error("Copied less than advertised data, "
     463                            "something is wrong");
    462464        }
    463465        /* push to all streams */
Note: See TracChangeset for help on using the changeset viewer.