mirror of
https://github.com/vgmstream/vgmstream.git
synced 2024-11-24 23:10:10 +01:00
Merge pull request #938 from NicknineTheEagle/desc-fix
Properly initialize input buffer in describe_vgmstream
This commit is contained in:
commit
dc7b82cd9d
@ -911,6 +911,8 @@ void describe_vgmstream(VGMSTREAM* vgmstream, char* desc, int length) {
|
|||||||
char temp[TEMPSIZE];
|
char temp[TEMPSIZE];
|
||||||
double time_mm, time_ss;
|
double time_mm, time_ss;
|
||||||
|
|
||||||
|
desc[0] = '\0';
|
||||||
|
|
||||||
if (!vgmstream) {
|
if (!vgmstream) {
|
||||||
snprintf(temp,TEMPSIZE, "NULL VGMSTREAM");
|
snprintf(temp,TEMPSIZE, "NULL VGMSTREAM");
|
||||||
concatn(length,desc,temp);
|
concatn(length,desc,temp);
|
||||||
|
@ -539,17 +539,15 @@ void winamp_SetPan(int pan) {
|
|||||||
/* display info box (ALT+3) */
|
/* display info box (ALT+3) */
|
||||||
int winamp_InfoBox(const in_char *fn, HWND hwnd) {
|
int winamp_InfoBox(const in_char *fn, HWND hwnd) {
|
||||||
char description[1024] = {0}, tmp[1024] = {0};
|
char description[1024] = {0}, tmp[1024] = {0};
|
||||||
size_t description_size = 1024;
|
TCHAR tbuf[1024] = {0};
|
||||||
double tmpVolume = 1.0;
|
double tmpVolume = 1.0;
|
||||||
|
|
||||||
concatn(description_size,description,PLUGIN_INFO "\n\n");
|
|
||||||
|
|
||||||
if (!fn || !*fn) {
|
if (!fn || !*fn) {
|
||||||
/* no filename = current playing file */
|
/* no filename = current playing file */
|
||||||
if (!vgmstream)
|
if (!vgmstream)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
describe_vgmstream(vgmstream,description,description_size);
|
describe_vgmstream(vgmstream,description,sizeof(description));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* some other file in playlist given by filename */
|
/* some other file in playlist given by filename */
|
||||||
@ -569,24 +567,21 @@ int winamp_InfoBox(const in_char *fn, HWND hwnd) {
|
|||||||
vgmstream_mixing_autodownmix(infostream, settings.downmix_channels);
|
vgmstream_mixing_autodownmix(infostream, settings.downmix_channels);
|
||||||
vgmstream_mixing_enable(infostream, 0, NULL, NULL);
|
vgmstream_mixing_enable(infostream, 0, NULL, NULL);
|
||||||
|
|
||||||
describe_vgmstream(infostream,description,description_size);
|
describe_vgmstream(infostream,description,sizeof(description));
|
||||||
|
|
||||||
close_vgmstream(infostream);
|
close_vgmstream(infostream);
|
||||||
infostream = NULL;
|
infostream = NULL;
|
||||||
tmpVolume = get_album_gain_volume(fn);
|
tmpVolume = get_album_gain_volume(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "\nvolume: %.6f\n", tmpVolume);
|
||||||
|
concatn(sizeof(description), description, tmp);
|
||||||
|
|
||||||
{
|
concatn(sizeof(description), description, "\n" PLUGIN_INFO);
|
||||||
TCHAR buf[1024] = {0};
|
|
||||||
size_t buf_size = 1024;
|
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "\nvolume: %.6f", tmpVolume);
|
cfg_char_to_wchar(tbuf, sizeof(tbuf) / sizeof(TCHAR), description);
|
||||||
concatn(description_size, description, tmp);
|
MessageBox(hwnd, tbuf, TEXT("Stream info"), MB_OK);
|
||||||
|
|
||||||
cfg_char_to_wchar(buf, buf_size, description);
|
|
||||||
MessageBox(hwnd,buf,TEXT("Stream info"),MB_OK);
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user