aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index e553a994d..408201706 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -525,7 +525,7 @@ static void *monmp3thread(void *data)
close(class->srcfd);
class->srcfd = -1;
pthread_testcancel();
- if (class->pid) {
+ if (class->pid > 1) {
kill(class->pid, SIGHUP);
usleep(100000);
kill(class->pid, SIGTERM);
@@ -778,6 +778,10 @@ static int moh_scan_files(struct mohclass *class) {
if ((strlen(files_dirent->d_name) < 4))
continue;
+ /* Skip standard license file - it is not audio */
+ if (!strcmp(files_dirent->d_name, "LICENSE"))
+ continue;
+
snprintf(filepath, sizeof(filepath), "%s/%s", class->dir, files_dirent->d_name);
if (stat(filepath, &statbuf))
@@ -1095,7 +1099,7 @@ static void ast_moh_destroy(void)
AST_LIST_LOCK(&mohclasses);
while ((moh = AST_LIST_REMOVE_HEAD(&mohclasses, list))) {
- if (moh->pid) {
+ if (moh->pid > 1) {
ast_log(LOG_DEBUG, "killing %d!\n", moh->pid);
stime = time(NULL) + 2;
pid = moh->pid;