changeset 3072:8f56795e348d

crossfade-ng: correctly workaround possible buffer starvation issues with streams
author William Pitcock <nenolod@atheme.org>
date Sun, 26 Apr 2009 00:01:59 -0500
parents ca7d5de41217
children fbe76a1d61e2
files src/crossfade/crossfade.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/crossfade/crossfade.c	Fri Apr 24 22:24:01 2009 -0500
+++ b/src/crossfade/crossfade.c	Sun Apr 26 00:01:59 2009 -0500
@@ -967,12 +967,8 @@
 	g_free(last_filename);
 	last_filename = g_strdup(file);
 
-	/* cleanup */
-	g_free(file); file = NULL;
-	g_free(title); title = NULL;
-
-	/* check for HTTP streaming */
-	if (config->enable_http_workaround && (0 == strncasecmp(file, "http://", 7)))
+	/* check for streaming */
+	if (aud_vfs_is_remote(file))
 	{
 		DEBUG(("[crossfade] open_audio: HTTP underrun workaround enabled.\n"));
 		is_http = TRUE;
@@ -980,6 +976,9 @@
 	else
 		is_http = FALSE;
 
+	g_free(file); file = NULL;
+	g_free(title); title = NULL;
+
 	/* lock buffer */
 	MUTEX_LOCK(&buffer_mutex);