Changeset 3774:f751c7edf8d1 in roaraudio for libroaross


Ignore:
Timestamp:
05/06/10 21:20:14 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support some basic VIO based selects()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r3773 r3774  
    13501350 struct roar_vio_selecttv rtv; 
    13511351 struct roar_vio_select * sv  = NULL; 
     1352 struct pointer * pointer; 
     1353 struct handle  * handle; 
    13521354 ssize_t ret; 
    13531355 size_t num = 0; 
     
    14241426  if ( i_r || i_w || i_e ) { 
    14251427   // TODO: use VIO for pointers... 
    1426    sv[idx].vio     = NULL; 
    1427    sv[idx].fh      = i; 
     1428   if ( (pointer = _get_pointer_by_fh(i)) != NULL ) { 
     1429    handle = pointer->handle; 
     1430    sv[idx].vio     = NULL; 
     1431    sv[idx].fh      = -1; 
     1432    switch (handle->type) { 
     1433     case HT_DMX: 
     1434     case HT_STREAM: 
     1435       if ( ! handle->stream_opened ) { 
     1436        // implement this as statichly return OK 
     1437        errno = ENOSYS; 
     1438        return -1; 
     1439       } 
     1440     case HT_VIO: 
     1441       sv[idx].vio = &(handle->stream_vio); 
     1442      break; 
     1443     default: /* non supported type */ 
     1444       errno = EINVAL; 
     1445       return -1; 
     1446      break; 
     1447    } 
     1448   } else { 
     1449    sv[idx].vio     = NULL; 
     1450    sv[idx].fh      = i; 
     1451   } 
    14281452 
    14291453   sv[idx].ud.si   = i; 
Note: See TracChangeset for help on using the changeset viewer.