mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 18:23:56 +00:00
TimelinePipeline: Make sure fwrite completes successfully
This commit is contained in:
parent
9d584d4343
commit
fc62bc7518
1 changed files with 6 additions and 3 deletions
|
@ -761,6 +761,7 @@ ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
|
||||||
GstBuffer *b;
|
GstBuffer *b;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
gboolean res = TRUE;
|
||||||
|
|
||||||
caps = gst_caps_from_string (format);
|
caps = gst_caps_from_string (format);
|
||||||
|
|
||||||
|
@ -772,16 +773,18 @@ ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
|
||||||
|
|
||||||
if (!(b = ges_timeline_pipeline_get_thumbnail_buffer (self, caps))) {
|
if (!(b = ges_timeline_pipeline_get_thumbnail_buffer (self, caps))) {
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
return FALSE;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
fp = fopen (location, "w+");
|
fp = fopen (location, "w+");
|
||||||
fwrite (GST_BUFFER_DATA (b), GST_BUFFER_SIZE (b), 1, fp);
|
if (fwrite (GST_BUFFER_DATA (b), GST_BUFFER_SIZE (b), 1,
|
||||||
|
fp) != GST_BUFFER_SIZE (b))
|
||||||
|
res = FALSE;
|
||||||
|
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
gst_buffer_unref (b);
|
gst_buffer_unref (b);
|
||||||
return TRUE;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue