Changeset 113:a032ff209b90 in roaraudio for roard/meta.c


Ignore:
Timestamp:
07/13/08 04:23:57 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added stream_meta_list() and done other support for listing meta tags on streams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/meta.c

    r107 r113  
    7070     continue; 
    7171 
     72   if ( s->meta[i].value == NULL ) 
     73    return -1; 
     74 
    7275   if ( (vallen = strlen(s->meta[i].value)) > (len - 1) ) { 
    7376    ROAR_DBG("stream_meta_get(*): val too small: need %i have %i", vallen, len); 
     
    8386 
    8487 return -1; 
     88} 
     89 
     90int stream_meta_list  (int id, int * types, size_t len) { 
     91 int i, j; 
     92 int have = 0; 
     93 int found; 
     94 struct roar_stream_server * s = g_streams[id]; 
     95 
     96 if ( s == NULL ) 
     97  return -1; 
     98 
     99 if ( len < ROAR_META_MAX_PER_STREAM ) // TODO: find a way we do not need this 
     100  return -1; 
     101 
     102 types[0] = -1; 
     103 
     104 for (i = 0; i < ROAR_META_MAX_PER_STREAM; i++) { 
     105  found = 0; 
     106  for (j = 0; j < have; j++) 
     107   if ( types[j] == s->meta[i].type ) { 
     108    found = 1; 
     109    break; 
     110   } 
     111 
     112  if ( !found ) 
     113   types[have++] = s->meta[i].type; 
     114 } 
     115 
     116 return have; 
    85117} 
    86118 
Note: See TracChangeset for help on using the changeset viewer.