Changeset 207:07ebcec64ab8 in roaraudio
- Timestamp:
- 07/21/08 01:47:38 (16 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/codecfilter_vorbis.c
r206 r207 67 67 break; 68 68 } else { 69 if ( self->last_section != self->current_section ) 70 if ( cf_vorbis_update_stream(self) == -1 ) 71 return 0; 72 73 self->last_section = self->current_section; 69 74 todo -= r; 70 75 done += r; … … 82 87 } 83 88 89 int cf_vorbis_update_stream (struct codecfilter_vorbis_inst * self) { 90 vorbis_info *vi = ov_info(&(self->vf), -1); 91 char **ptr = ov_comment(&(self->vf), -1)->user_comments; 92 char key[80] = {0}, value[80] = {0}; 93 struct roar_stream * s = (struct roar_stream *) self->stream; 94 int type; 95 int j, h = 0; 96 97 s->info.channels = vi->channels; 98 s->info.rate = vi->rate; 99 s->info.bits = 16; 100 s->info.codec = ROAR_CODEC_DEFAULT; 101 102 stream_meta_clear(s->id); 103 104 while(*ptr){ 105 for (j = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) 106 key[j] = (*ptr)[j]; 107 key[j] = 0; 108 109 for (j++, h = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) 110 value[h++] = (*ptr)[j]; 111 value[h] = 0; 112 113 type = roar_meta_inttype(key); 114 if ( type != -1 ) 115 stream_meta_set(s->id, type, "", value); 116 117 ROAR_DBG("cf_vorbis_update_stream(*): Meta %-16s: %s", key, value); 118 ++ptr; 119 } 120 121 return 0; 122 } 123 84 124 //ll -
roard/include/codecfilter_vorbis.h
r205 r207 25 25 int cf_vorbis_read(CODECFILTER_USERDATA_T inst, char * buf, int len); 26 26 27 int cf_vorbis_update_stream (struct codecfilter_vorbis_inst * self); 28 27 29 #endif 28 30
Note: See TracChangeset
for help on using the changeset viewer.