- if (in->param && in->param[0]) {
- num_probes = strtoul(in->param, NULL, 10);
- if (num_probes < 1)
- return SR_ERR;
- } else {
- num_probes = DEFAULT_NUM_PROBES;
+ (void)filename;
+
+ if (!(ctx = g_try_malloc0(sizeof(*ctx)))) {
+ sr_err("Input format context malloc failed.");
+ return SR_ERR_MALLOC;
+ }
+
+ num_probes = DEFAULT_NUM_PROBES;
+ ctx->samplerate = 0;
+
+ if (in->param) {
+ param = g_hash_table_lookup(in->param, "numprobes");
+ if (param) {
+ num_probes = strtoul(param, NULL, 10);
+ if (num_probes < 1)
+ return SR_ERR;
+ }
+
+ param = g_hash_table_lookup(in->param, "samplerate");
+ if (param) {
+ if (sr_parse_sizestring(param, &ctx->samplerate) != SR_OK)
+ return SR_ERR;
+ }