Changeset 120:85463285ddbe in roaraudio
- Timestamp:
- 07/13/08 15:03:19 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarvorbis.c
r118 r120 35 35 int i; 36 36 FILE * in; 37 int out ;37 int out = -1; 38 38 struct roar_connection con; 39 39 struct roar_stream s; … … 41 41 int eof=0; 42 42 int current_section; 43 int last_section = -1; 43 44 char pcmout[4096]; 44 45 … … 86 87 fprintf(stderr, "Audio: %i channel, %liHz\n\n", vi->channels, vi->rate); 87 88 88 if ( roar_stream_new(&s, vi->rate, vi->channels, bits, codec) == -1 ) { 89 roar_disconnect(&con); 90 return -1; 91 } 92 93 if ( roar_stream_connect(&con, &s, ROAR_DIR_PLAY) == -1 ) { 89 if ( (out = roar_simple_new_stream_obj(&con, &s, vi->rate, vi->channels, bits, codec, ROAR_DIR_PLAY)) == -1 ) { 94 90 roar_disconnect(&con); 95 91 return -1; … … 105 101 meta.value = value; 106 102 meta.key[0] = 0; 103 104 roar_stream_meta_set(&con, &s, ROAR_META_MODE_CLEAR, &meta); 107 105 108 106 meta.type = ROAR_META_TYPE_FILENAME; … … 131 129 } 132 130 133 if ( roar_stream_exec(&con, &s) == -1 ) {134 roar_disconnect(&con);135 return -1;136 }137 138 131 while (!eof) { 139 132 long ret = ov_read(&vf, pcmout, sizeof(pcmout), 0, 2, 1, ¤t_section); 133 134 last_section = current_section; 135 140 136 if (ret == 0) { 141 137 /* EOF */ … … 147 143 /* we don't bother dealing with sample rate changes, etc, but 148 144 you'll have to */ 149 write( con.fh, pcmout, ret);145 write(out, pcmout, ret); 150 146 } 151 147 } … … 154 150 155 151 // fclose(in); 156 close(con.fh); 152 close(out); 153 roar_disconnect(&con); 157 154 158 155 return 0;
Note: See TracChangeset
for help on using the changeset viewer.