tools: gst-launch: return non-0 exit code on async error
[platform/upstream/gstreamer.git] / tools / gst-launch.c
index 839bd64..d608271 100644 (file)
@@ -371,6 +371,7 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused)
         g_warning ("Couldn't fetch sample for %s tag", tag);
         g_assert_not_reached ();
       }
+      gst_sample_unref (sample);
     } else if (gst_tag_get_type (tag) == GST_TYPE_DATE_TIME) {
       GstDateTime *dt = NULL;
 
@@ -1171,6 +1172,8 @@ main (int argc, char *argv[])
     gst_element_set_state (pipeline, GST_STATE_READY);
     gst_element_get_state (pipeline, &state, &pending, GST_CLOCK_TIME_NONE);
 
+    res = caught_error;
+
 #if 0
     if (check_index) {
       print_index_stats (index_stats);