in->format = input_format;
in->param = fmtargs;
if (in->format->init) {
- if (in->format->init(in) != SR_OK) {
+ if (in->format->init(in, opt_input_file) != SR_OK) {
g_critical("Input format init failed.");
exit(1);
}
return SR_ERR;
}
- if (sr_driver_hwcap_exists(sdi->driver, SR_CONF_LIMIT_MSEC)) {
+ if (sr_dev_has_option(sdi, SR_CONF_LIMIT_MSEC)) {
if (sr_config_set(sdi, SR_CONF_LIMIT_MSEC, &time_msec) != SR_OK) {
g_critical("Failed to configure time limit.");
sr_session_destroy();
* convert to samples based on the samplerate.
*/
limit_samples = 0;
- if (sr_dev_has_hwcap(sdi, SR_CONF_SAMPLERATE)) {
+ if (sr_dev_has_option(sdi, SR_CONF_SAMPLERATE)) {
sr_config_get(sdi->driver, SR_CONF_SAMPLERATE,
(const void **)&samplerate, sdi);
limit_samples = (*samplerate) * time_msec / (uint64_t)1000;
}
if (opt_continuous) {
- if (!sr_driver_hwcap_exists(sdi->driver, SR_CONF_CONTINUOUS)) {
+ if (!sr_dev_has_option(sdi, SR_CONF_CONTINUOUS)) {
g_critical("This device does not support continuous sampling.");
sr_session_destroy();
return;