summaryrefslogtreecommitdiff
path: root/src/rharchive.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rharchive.c')
-rw-r--r--src/rharchive.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/rharchive.c b/src/rharchive.c
index a2ff037..234f47b 100644
--- a/src/rharchive.c
+++ b/src/rharchive.c
@@ -84,7 +84,6 @@ int main_loop(options_t* opt)
log_printf(INFO, "entering main loop");
GMainLoop *loop;
-
GstElement *pipeline, *source, *writer;
GstBus *bus;
@@ -109,8 +108,8 @@ int main_loop(options_t* opt)
GError *error = NULL;
source = gst_parse_bin_from_description(opt->src_bin_desc_, TRUE, &error);
- if(error) {
- log_printf(ERROR, "Source Bin Description Parser Error: %s", error->message);
+ if(!source || error) {
+ log_printf(ERROR, "Source Bin Description Parser Error: %s", error ? error->message : "unknown");
g_error_free(error);
return -1;
}
@@ -141,17 +140,16 @@ int main(int argc, char* argv[])
options_t opt;
int ret = options_parse(&opt, argc, argv);
if(ret) {
- if(ret > 0) {
+ if(ret > 0)
fprintf(stderr, "syntax error near: %s\n\n", argv[ret]);
- }
- if(ret == -2) {
+ if(ret == -2)
fprintf(stderr, "memory error on options_parse, exitting\n");
- }
- if(ret == -3) {
+ if(ret == -3)
options_print_version();
- }
+ if(ret == -4)
+ fprintf(stderr, "the length must be bigger than 0\n");
- if(ret != -2 && ret != -3)
+ if(ret != -2 && ret != -3 && ret != -4)
options_print_usage();
if(ret == -1 || ret == -3)
@@ -225,7 +223,7 @@ int main(int argc, char* argv[])
signal_init();
gst_init(NULL, NULL);
- const gchar *nano_str;
+ const gchar *nano_str;
guint major, minor, micro, nano;
gst_version(&major, &minor, &micro, &nano);
if (nano == 1)