~ft/dumb

fbd0eed489f59a6fbca4eee56eef7e3f8ad52e29 — Sigrid Solveig Haflínudóttir 1 year, 8 months ago 52c5794 master
moddec: do not play anything if seeking past the end
1 files changed, 5 insertions(+), 2 deletions(-)

M examples/moddec.c
M examples/moddec.c => examples/moddec.c +5 -2
@@ 20,10 20,10 @@ usage(void)
void
main(int argc, char **argv)
{
	double pos, freq, ratio, dur;
	DUMB_IT_SIGRENDERER *itren;
	DUH_SIGRENDERER *ren;
	int n, sz, r, resamp;
	double pos, freq, ratio;
	sample_t **samp;
	char *data, *t;
	long nsamp;


@@ 75,7 75,10 @@ main(int argc, char **argv)
		sysfatal("unknown/invalid mod");
	if((t = (char*)duh_get_tag(f, "TITLE")) != nil && *t)
		fprint(2, "%s\n", t);
	fprint(2, "duration: %g\n", duh_get_length(f)*ratio/100000.0);
	dur = duh_get_length(f)*ratio/100000.0;
	fprint(2, "duration: %g\n", dur);
	if(pos > dur)
		exits(nil);
	ren = duh_start_sigrenderer(f, 0, 2, pos*100000.0/ratio);
	itren = duh_get_it_sigrenderer(ren);
	dumb_it_set_loop_callback(itren, dumb_it_callback_terminate, nil);