rem: decoder->pos = seekTime * decoder->frequency * (decoder->format == decoder_formats.mono16 ? 2 : 4) / 1000;
add: uint32 pcm_pos = seekTime * decoder->frequency / 1000; decoder->pos = pcm_pos * (decoder->format == decoder_formats.mono16 ? 2 : 4);
context: void SoundDecoder_Seek (TFB_SoundDecoder *decoder, uint32 seekTime){	switch (decoder->type)	{		case SOUNDDECODER_WAV:		{			fprintf (stderr, "SoundDecoder_Seek(): unimplemented for wav\n");			break;		}		case SOUNDDECODER_MOD:		{			MODULE *mod = (MODULE *)decoder->data;			Player_Start (mod);			if (seekTime)				fprintf (stderr, "SoundDecoder_Seek(): non-zero seek positions not supported for mod\n");			Player_SetPosition (0);			//fprintf (stderr, "SoundDecoder_Rewind(): rewound %s\n", decoder->filename);			decoder->error = SOUNDDECODER_OK;			return;		}		case SOUNDDECODER_OGG:		{			int err;			uint32 pcm_pos = 0;			OggVorbis_File *vf = (OggVorbis_File *) decoder->data;			if (seekTime)				pcm_pos = seekTime * decoder->frequency / 1000;			if ((err = ov_pcm_seek (vf, decoder->start_sample + pcm_pos)) != 0)			{				fprintf (stderr, "SoundDecoder_Seek(): couldn't seek %s, error code %d\n", decoder->filename, err);				break;			}			if (decoder->format == decoder_formats.mono16)				decoder->pos = (pcm_pos + decoder->start_sample) * 2;			else				decoder->pos = (pcm_pos + decoder->start_sample) * 4;			//fprintf (stderr, "SoundDecoder_Seek(): seek %s\n", decoder->filename);			decoder->error = SOUNDDECODER_OK;			return;		}		case SOUNDDECODER_BUF:		{			decoder->pos = seekTime * decoder->frequency *				(decoder->format == decoder_formats.mono16 ? 2 : 4) / 1000;			decoder->error = SOUNDDECODER_OK;			return;		}		case SOUNDDECODER_NULL:			decoder->pos = seekTime * decoder->frequency * 2 / 1000;			decoder->error = SOUNDDECODER_OK;			return;		default:		{			fprintf (stderr, "SoundDecoder_Seek(): unknown type %d\n", decoder->type);			break;		}	}	decoder->error = SOUNDDECODER_ERROR;}