shithub: dumb

Download patch

ref: 7c1e30edb5700a7751281cc0f8e5e3bb4934989f
parent: 153721b1c9f4cde62fa17d6aef56f782b37384bf
author: Chris Moeller <kode54@gmail.com>
date: Tue Jun 4 06:57:59 EDT 2013

Small fix for possible issue with time reporting for looped modules if callback ends playback

--- a/dumb/src/it/itrender.c
+++ b/dumb/src/it/itrender.c
@@ -5777,6 +5777,7 @@
 	long pos;
 	int dt;
 	long todo;
+	int ret;
 	LONG_LONG time_left, t;
 
 	if (sigrenderer->order < 0) return 0; // problematic
@@ -5809,11 +5810,7 @@
 		sigrenderer->time_played += time_left;
 #endif
 
-		if (process_tick(sigrenderer)) {
-			sigrenderer->order = -1;
-			sigrenderer->row = -1;
-			return pos;
-		}
+		ret = process_tick(sigrenderer);
 
 #ifdef BIT_ARRAY_BULLSHIT
 		if (sigrenderer->looped == 1) {
@@ -5824,6 +5821,12 @@
 			break;
 		}
 #endif
+
+		if (ret) {
+			sigrenderer->order = -1;
+			sigrenderer->row = -1;
+			return pos;
+		}
 	}
 
 	render(sigrenderer, volume, delta, pos, size, samples);