Changeset 2417:ca4883b53c04 in roaraudio


Ignore:
Timestamp:
08/18/09 04:33:45 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

recsource can only be set ones

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/include/streams.h

    r2415 r2417  
    8282 
    8383int streams_thru_num; 
     84int streams_recsource_id; 
    8485 
    8586int streams_init   (void); 
  • roard/streams.c

    r2416 r2417  
    2525#include "roard.h" 
    2626 
    27 int streams_thru_num = 0; 
     27int streams_thru_num     =  0; 
     28int streams_recsource_id = -1; 
    2829 
    2930int streams_init (void) { 
     
    141142 ROAR_DBG("streams_delete(id=%i): g_streams[id]->id=%i", id, ROAR_STREAM(s)->id); 
    142143 
     144 if ( streams_get_flag(id, ROAR_FLAG_RECSOURCE) == 1 ) 
     145  streams_reset_flag(id, ROAR_FLAG_RECSOURCE); 
     146 
    143147 for (i = 0; i < ROAR_STREAMS_MAX; i++) { 
    144148  if ( g_streams[i] != NULL && ROAR_STREAM(g_streams[i])->pos_rel_id == id ) { 
     
    508512 } 
    509513 
     514 if ( flag & ROAR_FLAG_RECSOURCE ) { 
     515  if ( streams_recsource_id != -1 ) { 
     516   if ( streams_reset_flag(streams_recsource_id, ROAR_FLAG_RECSOURCE) == -1 ) 
     517    return -1; 
     518  } 
     519 
     520  streams_recsource_id = id; 
     521 } 
     522 
    510523 g_streams[id]->flags |= flag; 
    511524 
     
    521534 if ( g_streams[id] == NULL ) 
    522535  return -1; 
     536 
     537 if ( flag & ROAR_FLAG_RECSOURCE ) 
     538  if ( streams_recsource_id == id ) 
     539   streams_recsource_id = -1; 
    523540 
    524541 if ( flag & ROAR_FLAG_MMAP ) 
Note: See TracChangeset for help on using the changeset viewer.