Changeset 5535:051e141134da in roaraudio
- Timestamp:
- 06/12/12 15:24:46 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroar/stream.h
r5381 r5535 61 61 int roar_stream_new (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec) _LIBROAR_ATTR_NONNULL_ALL; 62 62 63 int roar_stream_new_by_info (struct roar_stream * s, const struct roar_audio_info * info) _LIBROAR_STREAM_STDATTRS; 64 63 65 int roar_stream_set_rel_id(struct roar_stream * s, int id) _LIBROAR_ATTR_NONNULL_ALL; 64 66 int roar_stream_get_rel_id(struct roar_stream * s) _LIBROAR_STREAM_STDATTRS; -
include/roaraudio/stream.h
r5381 r5535 156 156 157 157 struct roar_audio_info info; 158 159 /*160 int datalen;161 char * database;162 int offset;163 char * dataoff;164 */165 158 }; 166 159 -
libroar/stream.c
r5463 r5535 86 86 } 87 87 88 if ( bits > ROAR_BITS_MAX ) { 89 roar_err_set(ROAR_ERROR_RANGE); 90 return -1; 91 } 92 88 93 s->fh = -1; 89 94 s->id = -1; … … 93 98 s->dir = ROAR_DIR_DEFAULT; 94 99 95 /*96 s->datalen = 0;97 s->offset = 0;98 99 s->database = NULL;100 s->dataoff = NULL;101 */102 103 100 s->info.rate = rate; 104 101 s->info.channels = channels; … … 106 103 s->info.codec = codec; 107 104 108 if ( bits > ROAR_BITS_MAX ) 109 return -1; 105 return 0; 106 } 107 108 int roar_stream_new_by_info (struct roar_stream * s, const struct roar_audio_info * info) { 109 if ( s == NULL ) { 110 roar_err_set(ROAR_ERROR_FAULT); 111 return -1; 112 } 113 114 if ( info->bits > ROAR_BITS_MAX ) { 115 roar_err_set(ROAR_ERROR_RANGE); 116 return -1; 117 } 118 119 s->fh = -1; 120 s->id = -1; 121 s->pos = 0; 122 s->pos_rel_id = -1; 123 124 s->dir = ROAR_DIR_DEFAULT; 125 126 s->info = *info; 110 127 111 128 return 0;
Note: See TracChangeset
for help on using the changeset viewer.