input: sr_input_free() is now a void function.
Its backend, input_module.cleanup(), is now also a void function.
This commit is contained in:
parent
7066fd4660
commit
d5cc282ff8
|
@ -138,7 +138,7 @@ SR_API int sr_input_scan_file(const char *filename, const struct sr_input **in);
|
||||||
SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in);
|
SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in);
|
||||||
SR_API int sr_input_send(const struct sr_input *in, GString *buf);
|
SR_API int sr_input_send(const struct sr_input *in, GString *buf);
|
||||||
SR_API int sr_input_end(const struct sr_input *in);
|
SR_API int sr_input_end(const struct sr_input *in);
|
||||||
SR_API int sr_input_free(const struct sr_input *in);
|
SR_API void sr_input_free(const struct sr_input *in);
|
||||||
|
|
||||||
/*--- output/output.c -------------------------------------------------------*/
|
/*--- output/output.c -------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -758,7 +758,7 @@ static int end(struct sr_input *in)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cleanup(struct sr_input *in)
|
static void cleanup(struct sr_input *in)
|
||||||
{
|
{
|
||||||
struct context *inc;
|
struct context *inc;
|
||||||
|
|
||||||
|
@ -775,8 +775,6 @@ static int cleanup(struct sr_input *in)
|
||||||
|
|
||||||
if (inc->sample_buffer)
|
if (inc->sample_buffer)
|
||||||
g_free(inc->sample_buffer);
|
g_free(inc->sample_buffer);
|
||||||
|
|
||||||
return SR_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
|
|
|
@ -548,28 +548,22 @@ SR_API int sr_input_end(const struct sr_input *in)
|
||||||
*
|
*
|
||||||
* @since 0.4.0
|
* @since 0.4.0
|
||||||
*/
|
*/
|
||||||
SR_API int sr_input_free(const struct sr_input *in)
|
SR_API void sr_input_free(const struct sr_input *in)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!in)
|
if (!in)
|
||||||
return SR_ERR_ARG;
|
return;
|
||||||
|
|
||||||
ret = SR_OK;
|
|
||||||
if (in->module->cleanup)
|
if (in->module->cleanup)
|
||||||
ret = in->module->cleanup((struct sr_input *)in);
|
in->module->cleanup((struct sr_input *)in);
|
||||||
if (in->sdi)
|
if (in->sdi)
|
||||||
sr_dev_inst_free(in->sdi);
|
sr_dev_inst_free(in->sdi);
|
||||||
if (in->buf->len > 64) {
|
if (in->buf->len > 64) {
|
||||||
/* That seems more than just some sub-unitsize leftover... */
|
/* That seems more than just some sub-unitsize leftover... */
|
||||||
sr_warn("Found %d unprocessed bytes at free time.", in->buf->len);
|
sr_warn("Found %d unprocessed bytes at free time.", in->buf->len);
|
||||||
}
|
}
|
||||||
if (in->buf)
|
g_string_free(in->buf, TRUE);
|
||||||
g_string_free(in->buf, TRUE);
|
|
||||||
g_free(in->priv);
|
g_free(in->priv);
|
||||||
g_free((gpointer)in);
|
g_free((gpointer)in);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -537,14 +537,12 @@ static int end(struct sr_input *in)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cleanup(struct sr_input *in)
|
static void cleanup(struct sr_input *in)
|
||||||
{
|
{
|
||||||
struct context *inc;
|
struct context *inc;
|
||||||
|
|
||||||
inc = in->priv;
|
inc = in->priv;
|
||||||
g_slist_free_full(inc->channels, free_channel);
|
g_slist_free_full(inc->channels, free_channel);
|
||||||
|
|
||||||
return SR_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct sr_option options[] = {
|
static struct sr_option options[] = {
|
||||||
|
|
|
@ -319,7 +319,7 @@ struct sr_input_module {
|
||||||
* @retval SR_OK Success
|
* @retval SR_OK Success
|
||||||
* @retval other Negative error code.
|
* @retval other Negative error code.
|
||||||
*/
|
*/
|
||||||
int (*cleanup) (struct sr_input *in);
|
void (*cleanup) (struct sr_input *in);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Output module instance. */
|
/** Output module instance. */
|
||||||
|
|
Loading…
Reference in New Issue