Changeset 704baed in mainline for uspace/lib/hound/src/protocol.c


Ignore:
Timestamp:
2013-04-05T14:31:50Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c5d6f9cf
Parents:
c5b8548
Message:

libhound: implement stream drain for playback streams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/src/protocol.c

    rc5b8548 r704baed  
    486486        ipc_call_t call;
    487487        size_t size = 0;
    488         while (async_data_write_receive_call(&callid, &call, &size)) {
     488        while (async_data_write_receive_call(&callid, &call, &size)
     489            || (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN)) {
     490                if (IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_DRAIN) {
     491                        int ret = ENOTSUP;
     492                        if (server_iface->drain_stream)
     493                                ret = server_iface->drain_stream(stream);
     494                        async_answer_0(callid, ret);
     495                        continue;
     496                }
    489497                char *buffer = malloc(size);
    490498                if (!buffer) {
     
    494502                int ret = async_data_write_finalize(callid, buffer, size);
    495503                if (ret == EOK) {
    496                         ret = server_iface->stream_data_write(stream, buffer, size);
     504                        ret = server_iface->stream_data_write(
     505                            stream, buffer, size);
    497506                }
    498507                async_answer_0(callid, ret);
    499508        }
    500         //TODO drain?
    501509        const int ret = IPC_GET_IMETHOD(call) == IPC_M_HOUND_STREAM_EXIT
    502510            ? EOK : EINVAL;
Note: See TracChangeset for help on using the changeset viewer.