summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2005-07-29 17:43:23 +0000
committerPav Lucistnik <pav@FreeBSD.org>2005-07-29 17:43:23 +0000
commit72b0788bc3e9b9b2a20ce5031a4b7de846304304 (patch)
tree7d9265a22b46edaeb71497cf8c51d7f275abcf21 /audio
parentUpdate to 0.6.4. This also fix the problem with fetching the distfile of (diff)
- 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
Notes
Notes: svn path=/head/; revision=140417
Diffstat (limited to 'audio')
-rw-r--r--audio/moc/files/patch-decoder__plugins_mp3_mp3.c19
-rw-r--r--audio/moc/files/patch-io_open.c57
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;