Changeset cc3c27ad in mainline


Ignore:
Timestamp:
2013-03-24T19:29:09Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c6a7b3a
Parents:
03c2d5f
Message:

libhound: Destroy streams on stream_exit

Location:
uspace/lib/hound
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/hound/include/hound/client.h

    r03c2d5f rcc3c27ad  
    5454void hound_context_destroy(hound_context_t *hound);
    5555
    56 int hound_context_enable(hound_context_t *hound);
    57 int hound_context_disable(hound_context_t *hound);
    58 
    5956int hound_context_set_main_stream_format(hound_context_t *hound,
    6057    unsigned channels, unsigned rate, pcm_sample_format_t format);
  • uspace/lib/hound/src/client.c

    r03c2d5f rcc3c27ad  
    5555        hound_context_t *context;
    5656} hound_stream_t;
     57
     58static inline hound_stream_t * hound_stream_from_link(link_t *l)
     59{
     60        return l ? list_get_instance(l, hound_stream_t, link) : NULL;
     61}
    5762
    5863typedef struct hound_context {
     
    120125{
    121126        assert(hound);
     127
     128        while (!list_empty(&hound->stream_list)) {
     129                link_t *first = list_first(&hound->stream_list);
     130                hound_stream_t *stream = hound_stream_from_link(first);
     131                hound_stream_destroy(stream);
     132        }
     133
    122134        hound_service_unregister_context(hound->session, hound->id);
    123135        hound_service_disconnect(hound->session);
    124136        free(hound->name);
    125137        free(hound);
    126 }
    127 
    128 int hound_context_enable(hound_context_t *hound)
    129 {
    130         assert(hound);
    131         return ENOTSUP;
    132 }
    133 int hound_context_disable(hound_context_t *hound)
    134 {
    135         assert(hound);
    136         return ENOTSUP;
    137138}
    138139
  • uspace/lib/hound/src/protocol.c

    r03c2d5f rcc3c27ad  
    412412                }
    413413                case IPC_M_HOUND_STREAM_ENTER: {
    414                         if (!server_iface || !server_iface->add_stream
    415                             || !server_iface->is_record_context) {
     414                        if (!server_iface || !server_iface->is_record_context
     415                            || !server_iface->add_stream
     416                            || !server_iface->rem_stream) {
    416417                                async_answer_0(callid, ENOTSUP);
    417418                                break;
     
    438439                                        async_answer_0(callid, EOK);
    439440                                        hound_server_write_data(stream);
     441                                        server_iface->rem_stream(
     442                                            server_iface->server, stream);
    440443                                } else {
    441444                                        async_answer_0(callid, ENOTSUP);
     
    445448                                        async_answer_0(callid, EOK);
    446449                                        hound_server_read_data(stream);
     450                                        server_iface->rem_stream(
     451                                            server_iface->server, stream);
    447452                                } else {
    448453                                        async_answer_0(callid, ENOTSUP);
Note: See TracChangeset for help on using the changeset viewer.