- if (name->value() == "native-file-data-format") {
- XMLProperty const * value = option->property ("value");
- if (value) {
- SampleFormat fmt = (SampleFormat) string_2_enum (option->property ("value")->value(), fmt);
- data_format = fmt;
- found_data_format = true;
- break;
- }
- }
- }
- }
- if (found_data_format) {
- break;
- }
- }
+ xmlAttrPtr attr;
+ for (attr = node->properties; attr; attr = attr->next) {
+ if (!strcmp ((const char*)attr->name, "sample-rate") && attr->children) {
+ sample_rate = atoi ((char*)attr->children->content);
+ found_sr = true;
+ }
+ }
+
+ node = node->children;
+ while (node != NULL) {
+ if (strcmp((const char*) node->name, "Config")) {
+ node = node->next;
+ continue;
+ }
+ for (node = node->children; node; node = node->next) {
+ xmlChar* pv = xmlGetProp (node, (const xmlChar*)"name");
+ if (pv && !strcmp ((const char*)pv, "native-file-data-format")) {
+ xmlFree (pv);
+ xmlChar* val = xmlGetProp (node, (const xmlChar*)"value");
+ if (val) {
+ SampleFormat fmt = (SampleFormat) string_2_enum (string ((const char*)val), fmt);
+ data_format = fmt;
+ found_data_format = true;
+ }
+ xmlFree (val);
+ break;
+ }
+ xmlFree (pv);
+ }
+ break;
+ }
+
+ xmlFreeParserCtxt(ctxt);