Changeset 4621:c20151c5eb6f in roaraudio


Ignore:
Timestamp:
11/23/10 15:34:24 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

test for correct set of mixer in case of forced mixer connect

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/stream.h

    r4583 r4621  
    5555}; 
    5656 
    57 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir); 
     57int roar_stream_connect  (struct roar_connection * con, struct roar_stream * s, int dir); 
     58int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer); 
    5859 
    5960int roar_stream_new     (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec); 
  • libroar/stream.c

    r4583 r4621  
    3636#include "libroar.h" 
    3737 
    38 int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir) { 
     38int roar_stream_connect  (struct roar_connection * con, struct roar_stream * s, int dir) { 
     39 return roar_stream_connect2(con, s, dir, -1); 
     40} 
     41 
     42int roar_stream_connect2 (struct roar_connection * con, struct roar_stream * s, int dir, int mixer) { 
    3943 struct roar_libroar_config * config = roar_libroar_get_config(); 
    4044 struct roar_stream  ms; 
     
    4751 
    4852 m.cmd     = ROAR_CMD_NEW_STREAM; 
    49  m.stream  = -1; 
     53 m.stream  = mixer; 
    5054 m.pos     = 0; 
    5155 
  • roard/req.c

    r4614 r4621  
    137137int req_on_new_stream  (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 
    138138 int stream; 
    139  struct roar_stream * s; 
     139 struct roar_stream_server * ss; 
     140 struct roar_stream        * s; 
    140141 struct roar_stream * source_stream; 
    141142 struct roar_audio_info * info; 
     
    149150 
    150151 ROAR_DBG("req_on_new_stream(client=%i, ...): getting stream...", client); 
    151  if ( streams_get_clientobj(stream, &s) == -1 ) { 
     152 if ( streams_get(stream, &ss) == -1 ) { 
    152153  streams_delete(stream); 
    153154  return -1; 
    154155 } 
     156 
     157 s = ROAR_STREAM(ss); 
    155158 
    156159 ROAR_DBG("req_on_new_stream(client=%i, ...): set client of stream...", client); 
     
    173176 // int streams_set_dir    (int id, int dir, int defaults) 
    174177 if ( streams_set_dir(stream, ROAR_STREAM(s)->dir, 1) == -1 ) { 
     178  streams_delete(stream); 
     179  return -1; 
     180 } 
     181 
     182 if ( mes->stream != -1 && mes->stream != ss->mixer_stream ) { 
    175183  streams_delete(stream); 
    176184  return -1; 
Note: See TracChangeset for help on using the changeset viewer.