summaryrefslogtreecommitdiff
path: root/cvorbis.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-08 09:48:10 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-08 09:48:10 +0200
commit9c28c865dcb60da85587f9ae8ac7099d4737e3f6 (patch)
treebd102c1c649fa592f166c17ae3adb59fc4a4a498 /cvorbis.c
parentcc33421f0796e7e0dbe215b4002f604bc3fea92d (diff)
added duration precalc and filetype for ogg vorbis
Diffstat (limited to 'cvorbis.c')
-rw-r--r--cvorbis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cvorbis.c b/cvorbis.c
index 563de6f5..585f100e 100644
--- a/cvorbis.c
+++ b/cvorbis.c
@@ -37,7 +37,6 @@ cvorbis_init (const char *fname, int track, float start, float end) {
//cvorbis.info.dataSize = ov_pcm_total (&vorbis_file, -1) * vi->channels * 2;
cvorbis.info.channels = vi->channels;
cvorbis.info.samplesPerSecond = vi->rate;
- cvorbis.info.duration = ov_seekable (&vorbis_file) ? ov_time_total (&vorbis_file, -1) : -1;
cvorbis.info.position = 0;
// printf ("vorbis info: bps: %d, size: %d, chan: %d, rate: %d, dur: %f\n", cvorbis.info.bitsPerSample, cvorbis.info.dataSize, cvorbis.info.channels, cvorbis.info.samplesPerSecond, cvorbis.info.duration);
return 0;
@@ -137,6 +136,8 @@ cvorbis_insert (playItem_t *after, const char *fname) {
}
}
}
+ it->filetype = "OggVorbis";
+ it->duration = ov_seekable (&vorbis_file) ? ov_time_total (&vorbis_file, -1) : -1;
if (!title_added) {
ps_add_meta (it, "title", NULL);
}