Ignore:
Timestamp:
2013-04-02T19:06:27Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
35ab943
Parents:
39c4d1f
Message:

hound: add connection class

This will enable N to M routing in the future

File:
1 edited

Legend:

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

    r39c4d1f rfa60cd69  
    5555
    5656static int client_sink_connection_change(audio_sink_t *sink, bool new);
    57 static int client_source_connection_change(audio_source_t *source);
     57static int client_source_connection_change(audio_source_t *source, bool new);
    5858static int client_source_update_data(audio_source_t *source, size_t size);
    5959
     
    111111}
    112112
    113 static int client_source_connection_change(audio_source_t *source)
     113static int client_source_connection_change(audio_source_t *source, bool new)
    114114{
    115115        assert(source);
    116116        audio_client_t *client = source->private_data;
    117         if (source->connected_sink) {
     117        if (new && list_count(&source->connections) == 1) {
     118                assert(!client->exch);
    118119                client->exch = async_exchange_begin(client->sess);
    119120                return client->exch ? EOK : ENOMEM;
    120121        }
    121         async_exchange_end(client->exch);
    122         client->exch = NULL;
     122        if (list_count(&source->connections) == 0) {
     123                assert(!new);
     124                async_exchange_end(client->exch);
     125                client->exch = NULL;
     126        }
    123127        return EOK;
    124128}
Note: See TracChangeset for help on using the changeset viewer.