Changeset 715:d88f46a43a03 in roaraudio
- Timestamp:
- 08/30/08 16:03:13 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roarclients/roarvorbis.c
r669 r715 66 66 int codec = ROAR_CODEC_DEFAULT; 67 67 char **ptr = ov_comment(vf, -1)->user_comments; 68 char key[ 80], value[80] = {0};68 char key[ROAR_META_MAX_NAMELEN], value[ROAR_META_MAX_NAMELEN] = {0}; 69 69 int j, h = 0; 70 70 struct roar_meta meta; 71 71 int need_new_stream = 0; 72 int meta_ok; 72 73 73 74 fprintf(stderr, "\n"); … … 106 107 meta.type = ROAR_META_TYPE_FILENAME; 107 108 108 strncpy(value, file, 79); 109 110 strncpy(value, file, ROAR_META_MAX_NAMELEN-1); 111 value[ROAR_META_MAX_NAMELEN-1] = 0; 109 112 roar_stream_meta_set(con, s, ROAR_META_MODE_SET, &meta); 110 113 111 114 while(*ptr){ 112 for (j = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) 115 meta_ok = 1; 116 117 for (j = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) { 118 if ( j == ROAR_META_MAX_NAMELEN ) { 119 ROAR_ERR("update_stream(*): invalid meta data: meta data key too long"); 120 meta_ok = 0; 121 j = 0; 122 break; 123 } 113 124 key[j] = (*ptr)[j]; 114 key[j] = 0; 115 116 for (j++, h = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) 117 value[h++] = (*ptr)[j]; 125 } 126 key[j] = 0; 127 128 if ( meta_ok ) { 129 for (j++, h = 0; (*ptr)[j] != 0 && (*ptr)[j] != '='; j++) { 130 if ( h == ROAR_META_MAX_NAMELEN ) { 131 ROAR_ERR("update_stream(*): invalid meta data: meta data value for key '%s' too long", key); 132 meta_ok = 0; 133 h = 0; 134 break; 135 } 136 value[h++] = (*ptr)[j]; 137 } 118 138 value[h] = 0; 119 120 meta.type = roar_meta_inttype(key); 121 if ( meta.type != -1 ) 122 roar_stream_meta_set(con, s, ROAR_META_MODE_SET, &meta); 123 124 fprintf(stderr, "Meta %-16s: %s\n", key, value); 125 ++ptr; 139 } 140 141 if ( meta_ok ) { 142 fprintf(stderr, "Meta %-16s: %s\n", key, value); 143 144 meta.type = roar_meta_inttype(key); 145 if ( meta.type != -1 ) 146 roar_stream_meta_set(con, s, ROAR_META_MODE_SET, &meta); 147 } 148 149 ptr++; 126 150 } 127 151 … … 203 227 if ( last_section != current_section ) 204 228 if ( update_stream(&con, &s, &out, &vf, file, &info) == -1 ) 205 return -1;229 return 1; 206 230 207 231 last_section = current_section;
Note: See TracChangeset
for help on using the changeset viewer.