static
void __mm_wfd_sink_ini_check_status(const char *path)
{
- struct stat ini_buff;
+ GStatBuf ini_buff;
wfd_sink_return_if_fail(path);
} else {
if (ini_buff.st_size < 5) {
wfd_sink_error("%s file size=%d, Corrupted! So, Removed", path, (int)ini_buff.st_size);
- g_remove(path);
+ if (g_remove(path) == -1) {
+ char buf[255] = {0, };
+ strerror_r(errno, buf, sizeof(buf));
+ wfd_sink_error("failed to delete corrupted ini [%s]", buf);
+ }
}
}
*
*/
+#include <glib.h>
+#include <glib/gstdio.h>
#include <stdio.h>
#include "mm_wfd_sink_util.h"
#include <tzplatform_config.h>
mm_wfd_sink_util_add_pad_probe_for_data_dump(GstElement *element, const gchar *pad_name)
{
GstPad *probe_pad = NULL;
+ char buf[256] = {0, };
if (element && pad_name)
probe_pad = gst_element_get_static_pad(element, pad_name);
elementname = gst_element_get_name(element);
snprintf(file_path, sizeof(file_path), TS_DUMP_FILE_FORMAT, DUMP_TS_DATA_PATH, elementname, pad_name);
MMWFDSINK_FREEIF(elementname);
- remove(file_path);
+ if (g_remove(file_path) == -1) {
+ strerror_r(errno, buf, sizeof(buf));
+ wfd_sink_error("Failed to delete old dump file. [%s]", buf);
+ }
wfd_sink_debug("add pad(%s) probe", GST_STR_NULL(GST_PAD_NAME(probe_pad)));
gst_pad_add_probe(probe_pad, GST_PAD_PROBE_TYPE_BUFFER, _mm_wfd_sink_util_dump, (gpointer)NULL, NULL);