From 9b329649f753d5d08661e02e6f2969a1035152c2 Mon Sep 17 00:00:00 2001 From: Ian Nartowicz Date: Tue, 10 Jun 2014 22:02:39 +0100 Subject: Only change seek offset for multiplexed files with Vorbis not the 1st stream --- plugins/vorbis/vorbis.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'plugins') 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); -- cgit v1.2.3