Return an error if transcode fails

This commit is contained in:
Arun Raghavan 2012-11-11 18:07:48 +05:30
parent ab23fa3af5
commit fcf14318de

View file

@ -22,6 +22,7 @@ static int transcode(const char *infile, const char *outfile,
GstBus *bus; GstBus *bus;
GstMessage *msg; GstMessage *msg;
gchar pipeline_str[1024]; gchar pipeline_str[1024];
int ret = 0;
init(); init();
@ -89,6 +90,8 @@ static int transcode(const char *infile, const char *outfile,
g_error_free(err); g_error_free(err);
g_free(debug_info); g_free(debug_info);
ret = -1;
goto done; goto done;
} }
@ -108,7 +111,7 @@ done:
gst_element_set_state (pipeline, GST_STATE_NULL); gst_element_set_state (pipeline, GST_STATE_NULL);
gst_object_unref (pipeline); gst_object_unref (pipeline);
return 0; return ret;
} }
jint Java_org_wikimedia_commons_Transcoder_transcode(JNIEnv* env, jint Java_org_wikimedia_commons_Transcoder_transcode(JNIEnv* env,