diff options
author | waker <wakeroid@gmail.com> | 2010-11-23 20:37:48 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2010-11-23 20:37:48 +0100 |
commit | a9f494a1681d0131645a3ec7334d4174f4f28b48 (patch) | |
tree | 6b6dbfa789bd40c9bedd18237765014d792776e1 /plugins/sid | |
parent | d97566500324fae7b66b11a35f4916ab8339e707 (diff) |
ensure SID plugin BPS is either 8 or 16
Diffstat (limited to 'plugins/sid')
-rw-r--r-- | plugins/sid/csid.cpp | 4 | ||||
-rw-r--r-- | plugins/sid/plugin.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/plugins/sid/csid.cpp b/plugins/sid/csid.cpp index 55eeea88..0682fb3f 100644 --- a/plugins/sid/csid.cpp +++ b/plugins/sid/csid.cpp @@ -314,6 +314,9 @@ csid_init (DB_fileinfo_t *_info, DB_playItem_t *it) { int samplerate = deadbeef->conf_get_int ("sid.samplerate", 44100); int bps = deadbeef->conf_get_int ("sid.bps", 16); + if (bps != 16 && bps != 8) { + bps = 16; + } info->resid->sampling (samplerate); info->duration = deadbeef->pl_get_item_duration (it); @@ -371,6 +374,7 @@ csid_read (DB_fileinfo_t *_info, char *bytes, int size) { int rd = info->sidplay->play (bytes, size); int samplesize = (_info->fmt.bps>>3) * _info->fmt.channels; + _info->readpos += rd / samplesize / (float)_info->fmt.samplerate; return rd; diff --git a/plugins/sid/plugin.c b/plugins/sid/plugin.c index 86475545..dad31b62 100644 --- a/plugins/sid/plugin.c +++ b/plugins/sid/plugin.c @@ -25,7 +25,7 @@ static const char settings_dlg[] = "property \"Enable HVSC\" checkbox hvsc_enable 0;\n" "property \"Songlenghts.txt (from HVSC)\" file hvsc_path \"\";\n" "property \"Samplerate\" entry sid.samplerate 44100;\n" - "property \"Bits per sample\" entry sid.bps 16;\n" + "property \"Bits per sample (8 or 16)\" entry sid.bps 16;\n" "property \"Default song length (sec)\" entry sid.defaultlength 180;\n" ; |