summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Ian Nartowicz <iann@crunchbang>2014-06-10 22:02:39 +0100
committerGravatar Ian Nartowicz <iann@crunchbang>2014-06-10 22:02:39 +0100
commit9b329649f753d5d08661e02e6f2969a1035152c2 (patch)
treec1897ce987c19c1253754c815301c290bc1f2937 /plugins
parent3c306dc3c5a2c099ba054b72a3c21ae9d9d00b17 (diff)
Only change seek offset for multiplexed files with Vorbis not the 1st stream
Diffstat (limited to 'plugins')
-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);