- g_string_truncate(ctx->header, ctx->header->len - 1);
- g_string_append_printf(ctx->header, "\n");
+ g_string_truncate(header, header->len - 1);
+ g_string_append_printf(header, "\n");
+
+ if (ctx->samplerate == 0) {
+ if (sr_config_get(o->sdi->driver, o->sdi, NULL, SR_CONF_SAMPLERATE,
+ &gvar) == SR_OK) {
+ ctx->samplerate = g_variant_get_uint64(gvar);
+ g_variant_unref(gvar);
+ }
+ }
+ if (ctx->samplerate != 0) {
+ samplerate_s = sr_samplerate_string(ctx->samplerate);
+ g_string_append_printf(header, "; Samplerate: %s\n", samplerate_s);
+ g_free(samplerate_s);
+ }