Changeset 741:9be48345d290 in roaraudio
- Timestamp:
- 09/04/08 19:46:49 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/codecfilter_vorbis.c
r717 r741 26 26 27 27 #ifdef ROAR_HAVE_LIBVORBISFILE 28 29 int _g_cf_vorbis_vfvio_return_err (void) { 30 return -1; 31 } 32 33 ov_callbacks _g_cf_vorbis_vfvio = { 34 .read_func = cf_vorbis_vfvio_read, 35 .seek_func = _g_cf_vorbis_vfvio_return_err, 36 .close_func = _g_cf_vorbis_vfvio_return_err, 37 .tell_func = _g_cf_vorbis_vfvio_return_err 38 }; 39 40 size_t cf_vorbis_vfvio_read (void *ptr, size_t size, size_t nmemb, void *datasource) { 41 ssize_t r; 42 r = stream_vio_s_read(ROAR_STREAM_SERVER(datasource), ptr, size*nmemb); 43 44 ROAR_WARN("cf_vorbis_vfvio_read(ptr=%p, size=%lu, nmemb=%lu, datasource=%p): r=%i", ptr, size, nmemb, datasource, r); 45 46 if ( r == -1 ) 47 return 0; 48 49 if ( r > 0 ) 50 errno = 0; 51 52 return r/nmemb; 53 } 28 54 29 55 int cf_vorbis_open(CODECFILTER_USERDATA_T * inst, int codec, … … 48 74 ROAR_DBG("cf_vorbis_open(*): info->id=%i", ROAR_STREAM(info)->id); 49 75 76 /* 50 77 if ( (self->in = fdopen(s->fh, "r")) == NULL ) { 51 78 free((void*)self); 52 79 return -1; 53 80 } 81 */ 54 82 55 83 *inst = (CODECFILTER_USERDATA_T) self; … … 210 238 if ( self->opened == 16 ) { 211 239 //printf("cf_vorbis_read(*): opening...\n"); 212 if ( ov_open(self->in, &(self->vf), NULL, 0) < 0 ) { 240 //int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); 241 if ( ov_open_callbacks((void*)self->stream, &(self->vf), NULL, 0, _g_cf_vorbis_vfvio) < 0 ) { 242 // if ( ov_open(self->in, &(self->vf), NULL, 0) < 0 ) { 213 243 // free((void*)self); 214 244 return 0; -
roard/include/codecfilter_vorbis.h
r668 r741 62 62 }; 63 63 64 size_t cf_vorbis_vfvio_read (void *ptr, size_t size, size_t nmemb, void *datasource); 65 64 66 int cf_vorbis_open(CODECFILTER_USERDATA_T * inst, int codec, 65 67 struct roar_stream_server * info, -
roard/streams.c
r740 r741 805 805 806 806 ssize_t stream_vio_s_read (struct roar_stream_server * stream, void *buf, size_t count) { 807 size_t len = 0;808 s ize_t r = -1;807 size_t len = 0; 808 ssize_t r = -1; 809 809 810 810 errno = 0;
Note: See TracChangeset
for help on using the changeset viewer.