}
free(list);
}
+
+/*
+ * Delete cutpoint files
+ */
+void
+dvr_cutpoint_delete_files (const char *s)
+{
+ char *path, *dot;
+ int i;
+
+ path = alloca(strlen(s) + 1);
+
+ /* Check each cutlist extension */
+ for (i = 0; i < ARRAY_SIZE(dvr_cutpoint_parsers); i++) {
+
+ strcpy(path, s);
+ if ((dot = (strrchr(path, '.') + 1)))
+ *dot = 0;
+
+ strcat(path, dvr_cutpoint_parsers[i].ext);
+
+ /* Check file exists */
+ if (access(path, F_OK))
+ continue;
+
+ /* Delete File */
+ tvhinfo(LS_MAIN, "Erasing cutpoint file '%s'", (const char *)path);
+ if (unlink(path))
+ tvherror(LS_MAIN, "unable to remove cutpoint file '%s'", (const char *)path);
+ }
+}
int mpegts_word_count(const uint8_t *tsb, int len, uint32_t mask);
int deferred_unlink(const char *filename, const char *rootdir);
+void dvr_cutpoint_delete_files (const char *s);
void sha1_calc(uint8_t *dst, const uint8_t *d1, size_t d1_len, const uint8_t *d2, size_t d2_len);
free(s);
return r;
}
- if (rootdir == NULL)
+ if (rootdir == NULL){
+ dvr_cutpoint_delete_files (filename);
tasklet_arm_alloc(deferred_unlink_cb, s);
+ }
else {
du = calloc(1, sizeof(*du));
if (du == NULL) {
}
du->filename = s;
du->rootdir = strdup(rootdir);
+ dvr_cutpoint_delete_files (filename);
tasklet_arm_alloc(deferred_unlink_dir_cb, du);
}
return 0;