Changeset 124:70992549a17a in roaraudio


Ignore:
Timestamp:
07/13/08 17:03:40 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added simple http support using wget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarvorbis.c

    r122 r124  
    2525       ); 
    2626 
     27} 
     28 
     29 
     30FILE * open_http (char * file) { 
     31 char cmd[1024]; 
     32 
     33 snprintf(cmd, 1023, "wget -qO - '%s'", file); 
     34 
     35 return popen(cmd, "r"); 
    2736} 
    2837 
     
    6675 roar_stream_meta_set(con, s, ROAR_META_MODE_CLEAR, &meta); 
    6776 
    68  meta.type = ROAR_META_TYPE_FILENAME; 
     77 if ( strncmp(file, "http:", 5) == 0 ) 
     78  meta.type = ROAR_META_TYPE_FILEURL; 
     79 else 
     80  meta.type = ROAR_META_TYPE_FILENAME; 
     81 
    6982 strncpy(value, file, 79); 
    7083 roar_stream_meta_set(con, s, ROAR_META_MODE_SET, &meta); 
     
    129142 } 
    130143 
    131  if ( (in = fopen(file, "rb")) == NULL ) { 
     144 if ( strncmp(file, "http:", 5) == 0 ) { 
     145  in = open_http(file); 
     146 } else { 
     147  in = fopen(file, "rb"); 
     148 } 
     149 
     150 if ( in == NULL ) { 
    132151  roar_disconnect(&con); 
    133152  return -1; 
Note: See TracChangeset for help on using the changeset viewer.