Changeset 2593:4bdafc96b459 in roaraudio


Ignore:
Timestamp:
09/11/09 01:03:52 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added new streams_new_virtual(), don't sure of the prototype

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/include/streams.h

    r2417 r2593  
    9898int streams_get_subsys (int id); 
    9999 
     100int streams_new_virtual (int parent); 
     101 
    100102int streams_set_fh     (int id, int fh); 
    101103int streams_get_fh     (int id); 
  • roard/streams.c

    r2592 r2593  
    322322} 
    323323 
     324#define _err() streams_delete(id); return -1; 
     325int streams_new_virtual (int parent) { 
     326 struct roar_stream_server * parent_ss, * ss; 
     327 struct roar_stream        * parent_s , *  s; 
     328 int id = -1; 
     329 int client, dir; 
     330 
     331 if ( streams_get(parent, &parent_ss) == -1 ) 
     332  return -1; 
     333 
     334 if ( (client = streams_get_client(parent)) == -1 ) 
     335  return -1; 
     336 
     337 if ( (dir = streams_get_dir(parent)) == -1 ) 
     338  return -1; 
     339 
     340 if ( (id = streams_new()) == -1 ) { 
     341  return -1; 
     342 } 
     343 
     344 if ( streams_set_client(id, client) == -1 ) { 
     345  _err(); 
     346 } 
     347 
     348 if ( streams_get(id, &ss) == -1 ) { 
     349  _err(); 
     350 } 
     351 
     352 if ( streams_set_dir(id, dir, 1) == -1 ) { 
     353  _err(); 
     354 } 
     355 
     356 s        = ROAR_STREAM(       ss); 
     357 parent_s = ROAR_STREAM(parent_ss); 
     358 
     359 s->pos_rel_id = id; 
     360 
     361 if ( streams_set_flag(id, ROAR_FLAG_VIRTUAL) == -1 ) { 
     362  _err(); 
     363 } 
     364 
     365 return id; 
     366} 
     367#undef _err 
     368 
    324369int streams_set_fh     (int id, int fh) { 
    325370 struct roar_stream_server * ss; 
Note: See TracChangeset for help on using the changeset viewer.