From c35074499a9d7fe7e3f68591500eaa7bf0cdc627 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 5 Nov 2010 11:08:01 +0100 Subject: [PATCH] qtmux: avoid removing temp file when error occurred --- gst/quicktime/gstqtmux.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gst/quicktime/gstqtmux.c b/gst/quicktime/gstqtmux.c index 83ac60c085..e128e16740 100644 --- a/gst/quicktime/gstqtmux.c +++ b/gst/quicktime/gstqtmux.c @@ -1125,13 +1125,21 @@ flush_failed: GST_ELEMENT_ERROR (qtmux, RESOURCE, WRITE, ("Failed to flush temporary file"), GST_ERROR_SYSTEM); ret = GST_FLOW_ERROR; - return ret; + goto fail; } seek_failed: { GST_ELEMENT_ERROR (qtmux, RESOURCE, SEEK, ("Failed to seek temporary file"), GST_ERROR_SYSTEM); ret = GST_FLOW_ERROR; + goto fail; + } +fail: + { + /* clear descriptor so we don't remove temp file later on, + * might be possible to recover */ + fclose (qtmux->fast_start_file); + qtmux->fast_start_file = NULL; return ret; } }