sr: always use uint64_t for samplerate

This commit is contained in:
Bert Vermeulen 2012-07-29 02:45:40 +02:00
parent b04781bb2b
commit 0d1297a291
1 changed files with 2 additions and 4 deletions

View File

@ -30,7 +30,7 @@
#define DEFAULT_NUM_PROBES 8 #define DEFAULT_NUM_PROBES 8
struct context { struct context {
int samplerate; uint64_t samplerate;
}; };
static int format_match(const char *filename) static int format_match(const char *filename)
@ -67,12 +67,10 @@ static int init(struct sr_input *in)
param = g_hash_table_lookup(in->param, "samplerate"); param = g_hash_table_lookup(in->param, "samplerate");
if (param) { if (param) {
ctx->samplerate = strtoul(param, NULL, 10); if (sr_parse_sizestring(param, &ctx->samplerate) != SR_OK)
if (ctx->samplerate < 1) {
return SR_ERR; return SR_ERR;
} }
} }
}
/* Create a virtual device. */ /* Create a virtual device. */
in->vdev = sr_dev_new(NULL, 0); in->vdev = sr_dev_new(NULL, 0);