int
gst_maru_avcodec_close (CodecContext *ctx, CodecDevice *dev)
{
- int ret;
-
- GST_DEBUG ("close %d of context", ctx->index);
+ int ret = 0;
- if (ctx && ctx->index == 0) {
- GST_INFO ("context is not opened yet or context before %d", ctx->index);
+ if (!ctx || (ctx->index == 0)) {
+ GST_INFO ("context is null or closed before");
return -1;
}
- if (dev && dev->fd < 0) {
- GST_INFO ("fd is not opened yet or closed before %d", dev->fd);
+ if (!dev || (dev->fd < 0)) {
+ GST_INFO ("dev is null or fd is closed before");
return -1;
}
+ GST_DEBUG ("close %d of context", ctx->index);
+
g_mutex_lock (&gst_avcodec_mutex);
interface->deinit (ctx, dev);
g_mutex_unlock (&gst_avcodec_mutex);