summaryrefslogtreecommitdiff
path: root/cvorbis.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-07-06 20:44:39 +0200
committerGravatar waker <wakeroid@gmail.com>2009-07-06 20:44:39 +0200
commit2b583ad8d29236e88b34107d5e98c9889a95b4dc (patch)
tree11f618ceb0fdf9dc418350930011ceca7d2f7918 /cvorbis.c
parent70679eb6465814b368eb1ec91c6b450f324512b5 (diff)
position tracking, statusbar, seekbar updating, some cleanup
Diffstat (limited to 'cvorbis.c')
-rw-r--r--cvorbis.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cvorbis.c b/cvorbis.c
index f8b427f9..72969ee9 100644
--- a/cvorbis.c
+++ b/cvorbis.c
@@ -25,10 +25,11 @@ int cvorbis_init (const char *fname) {
ov_open (file, &vorbis_file, NULL, 0);
vi = ov_info (&vorbis_file, -1);
cvorbis.info.bitsPerSample = 16;
- cvorbis.info.dataSize = ov_pcm_total (&vorbis_file, -1) * vi->channels * 2;
+ //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;
}
@@ -76,6 +77,7 @@ cvorbis_read (char *bytes, int size)
break;
}
}
+ cvorbis.info.position = ov_time_tell(&vorbis_file);
return 0;
}