diff options
author | pav <pav@FreeBSD.org> | 2005-07-30 01:43:23 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2005-07-30 01:43:23 +0800 |
commit | 41c8873cb3089a4495efda2329825b74973aa101 (patch) | |
tree | 054b3907a451d3414bcc03d15acb4403797888ce /audio/moc | |
parent | bcd80a6e70a4c046efd788e173f5c1566aa6a993 (diff) | |
download | freebsd-ports-gnome-41c8873cb3089a4495efda2329825b74973aa101.tar.gz freebsd-ports-gnome-41c8873cb3089a4495efda2329825b74973aa101.tar.zst freebsd-ports-gnome-41c8873cb3089a4495efda2329825b74973aa101.zip |
- Patches to fix crash involving deleted files. Not bumping PORTREVISION
because the crash is rare (unless you delete files as you listen to them)
Approved by: maintainer
Obtained from: author
Diffstat (limited to 'audio/moc')
-rw-r--r-- | audio/moc/files/patch-decoder__plugins_mp3_mp3.c | 19 | ||||
-rw-r--r-- | audio/moc/files/patch-io_open.c | 57 |
2 files changed, 76 insertions, 0 deletions
diff --git a/audio/moc/files/patch-decoder__plugins_mp3_mp3.c b/audio/moc/files/patch-decoder__plugins_mp3_mp3.c new file mode 100644 index 000000000000..e4c715608bcc --- /dev/null +++ b/audio/moc/files/patch-decoder__plugins_mp3_mp3.c @@ -0,0 +1,19 @@ +--- decoder_plugins/mp3/mp3.c.orig Wed Jun 15 18:56:45 2005 ++++ decoder_plugins/mp3/mp3.c Fri Jul 29 14:28:05 2005 +@@ -353,10 +353,13 @@ + + debug ("Processing file %s", file); + +- if (!(data = mp3_open_internal(file, 0))) +- time = -1; +- else ++ data = mp3_open_internal (file, 0); ++ ++ if (data->ok) + time = data->duration; ++ else ++ time = -1; ++ + mp3_close (data); + + return time; diff --git a/audio/moc/files/patch-io_open.c b/audio/moc/files/patch-io_open.c new file mode 100644 index 000000000000..6ebf67000af3 --- /dev/null +++ b/audio/moc/files/patch-io_open.c @@ -0,0 +1,57 @@ +Index: io.c +=================================================================== +--- io.c (revision 1506) ++++ io.c (revision 1507) +@@ -300,16 +300,6 @@ + if (s->source == IO_SOURCE_FD) + close (s->fd); + +- if (pthread_mutex_destroy(&s->buf_mutex)) +- logit ("Destroying buf_mutex failed: %s", +- strerror(errno)); +- if (pthread_mutex_destroy(&s->io_mutex)) +- logit ("Destroying io_mutex failed: %s", +- strerror(errno)); +- if (pthread_mutex_destroy(&s->metadata.mutex)) +- logit ("Destroying metadata mutex failed: %s", +- strerror(errno)); +- + if (s->buffered) { + fifo_buf_destroy (&s->buf); + if (pthread_cond_destroy(&s->buf_free_cond)) +@@ -326,6 +316,13 @@ + free (s->metadata.url); + } + ++ if (pthread_mutex_destroy(&s->buf_mutex)) ++ logit ("Destroying buf_mutex failed: %s", strerror(errno)); ++ if (pthread_mutex_destroy(&s->io_mutex)) ++ logit ("Destroying io_mutex failed: %s", strerror(errno)); ++ if (pthread_mutex_destroy(&s->metadata.mutex)) ++ logit ("Destroying metadata mutex failed: %s", strerror(errno)); ++ + if (s->strerror) + free (s->strerror); + free (s); +@@ -493,6 +490,10 @@ + #endif + io_open_file (s, file); + ++ pthread_mutex_init (&s->buf_mutex, NULL); ++ pthread_mutex_init (&s->io_mutex, NULL); ++ pthread_mutex_init (&s->metadata.mutex, NULL); ++ + if (!s->opened) + return s; + +@@ -503,10 +504,6 @@ + s->pos = 0; + memset (&s->metadata, 0, sizeof(s->metadata)); + +- pthread_mutex_init (&s->buf_mutex, NULL); +- pthread_mutex_init (&s->io_mutex, NULL); +- pthread_mutex_init (&s->metadata.mutex, NULL); +- + if (buffered) { + fifo_buf_init (&s->buf, options_get_int("InputBuffer") * 1024); + s->prebuffer = options_get_int("Prebuffering") * 1024; |