summaryrefslogtreecommitdiff
path: root/plugins/vorbis
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-06 16:36:19 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-10-06 16:36:19 +0200
commite3a00b2a165b18cda5a34e5542d30d2fe208efb7 (patch)
tree05c592e3c761dcb1e01aa43c1c1a0850f0aff21d /plugins/vorbis
parentb94678c14fc637f565f8c1ec5792f80b5b3ee29c (diff)
vorbis: fixed bitrate
Diffstat (limited to 'plugins/vorbis')
-rw-r--r--plugins/vorbis/vorbis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index 1e828e9f..5851a95f 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -422,7 +422,7 @@ cvorbis_read (DB_fileinfo_t *_info, char *bytes, int size) {
}
_info->readpos = (float)(ov_pcm_tell(&info->vorbis_file)-info->startsample)/info->vi->rate;
//trace ("cvorbis_read got %d bytes, readpos %f, info->currentsample %d, ret %d\n", initsize-size, _info->readpos, info->currentsample, ret);
- deadbeef->streamer_set_bitrate (ov_bitrate_instant (&info->vorbis_file)/1000);
+ deadbeef->streamer_set_bitrate (ov_bitrate (&info->vorbis_file, info->cur_bit_stream)/1000);
return initsize - size;
}
@@ -529,7 +529,7 @@ cvorbis_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) {
deadbeef->pl_add_meta (it, ":CHANNELS", s);
snprintf (s, sizeof (s), "%d", samplerate);
deadbeef->pl_add_meta (it, ":SAMPLERATE", s);
- int br = (int)roundf(fsize / duration * 8 / 1000);
+ int br = ov_bitrate (&vorbis_file, stream)/1000;
snprintf (s, sizeof (s), "%d", br);
deadbeef->pl_add_meta (it, ":BITRATE", s);