summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/vorbis/vorbis.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index d998cb2e..9b2d8684 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -204,8 +204,14 @@ cvorbis_seek_sample (DB_fileinfo_t *_info, int sample) {
trace ("vorbis: file is NULL on seek\n");
return -1;
}
- if (sample == 0)
- sample = 1; // workaround libvorbis bug #1486 (ddb issue #1116)
+ if (sample == 0) {
+ deadbeef->pl_lock ();
+ const char *filetype = deadbeef->pl_find_meta_raw(info->it, ":FILETYPE");
+ if (filetype && strncmp(filetype, "Ogg Vorbis", 10)) {
+ sample = 1; // workaround libvorbis bug #1486 (ddb issue #1116)
+ }
+ deadbeef->pl_unlock ();
+ }
sample += info->it->startsample;
trace ("vorbis: seek to sample %d\n", sample);
int res = ov_pcm_seek (&info->vorbis_file, sample);