Changeset 4659:3bbce4638653 in roaraudio
- Timestamp:
- 12/12/10 22:53:18 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarvorbis.c
r4656 r4659 87 87 88 88 89 int update_stream (struct roar_connection * con,90 struct roar_stream *s,91 struct roar_vio_calls * vio,92 OggVorbis_File * vf,93 char * file,94 struct roar_ audio_info * info,95 struct roar_vio_calls * vclt) {89 int update_stream (struct roar_connection * con, 90 roar_vs_t ** vss, 91 OggVorbis_File * vf, 92 char * file, 93 struct roar_audio_info * info, 94 struct roar_vio_calls * vclt) { 95 struct roar_stream * s; 96 96 vorbis_info *vi = ov_info(vf, -1); 97 97 int bits = 16; 98 int codec = ROAR_CODEC_ DEFAULT;98 int codec = ROAR_CODEC_PCM_S_LE; 99 99 char **ptr = ov_comment(vf, -1)->user_comments; 100 100 char key[ROAR_META_MAX_NAMELEN], value[LIBROAR_BUFFER_MSGDATA] = {0}; … … 119 119 120 120 if ( need_new_stream ) { 121 if ( need_close ) 122 roar_vio_close(vio); 121 if ( need_close ) { 122 roar_vs_sync(*vss, ROAR_VS_WAIT, NULL); 123 roar_vs_close(*vss, ROAR_VS_FALSE, NULL); 124 } 123 125 124 126 fprintf(stderr, "Audio: %i channel, %liHz\n\n", vi->channels, vi->rate); … … 126 128 info->rate = vi->rate; 127 129 info->channels = vi->channels; 128 129 if ( roar_vio_simple_new_stream_obj(vio, con, s, vi->rate, vi->channels, bits, codec, ROAR_DIR_PLAY) == -1 ) { 130 info->bits = bits; 131 info->codec = codec; 132 133 *vss = roar_vs_new_from_con(con, NULL); 134 if ( *vss == NULL ) { 130 135 roar_disconnect(con); 131 136 return -1; 132 137 } 138 139 if ( roar_vs_stream(*vss, info, ROAR_DIR_PLAY, NULL) == -1 ) { 140 roar_vs_close(*vss, ROAR_VS_TRUE, NULL); 141 roar_disconnect(con); 142 return -1; 143 } 144 133 145 need_new_stream = 0; 134 146 } 135 147 148 s = roar_vs_stream_obj(*vss, NULL); 136 149 137 150 meta.value = value; … … 192 205 ptr++; 193 206 } 207 208 fprintf(stderr, "\n"); 194 209 195 210 *value = 0; … … 221 236 int i; 222 237 struct roar_connection con; 223 struct roar_stream s; 224 struct roar_vio_calls vio; 238 roar_vs_t * vss = NULL; 225 239 OggVorbis_File vf; 226 240 int eof=0; … … 297 311 298 312 if ( last_section != current_section ) 299 if ( update_stream(&con, & s, &vio, &vf, file, &info, vcltfile == NULL ? NULL : &vclt) == -1 ) {313 if ( update_stream(&con, &vss, &vf, file, &info, vcltfile == NULL ? NULL : &vclt) == -1 ) { 300 314 roar_vio_close(&in); 301 315 if ( vcltfile != NULL ) … … 313 327 case we (the app) cares. In this case, we don't. */ 314 328 } else { 315 roar_v io_write(&vio, pcmout, ret);329 roar_vs_write(vss, pcmout, ret, NULL); 316 330 } 317 331 } … … 320 334 321 335 // fclose(in); 322 roar_v io_close(&vio);336 roar_vs_close(vss, ROAR_VS_FALSE, NULL); 323 337 roar_disconnect(&con); 324 338
Note: See TracChangeset
for help on using the changeset viewer.