comparison src/crossfade/crossfade.c @ 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 c0ae2a5a15e8
children fbe76a1d61e2
comparison
equal deleted inserted replaced
3071:ca7d5de41217 3072:8f56795e348d
965 } 965 }
966 } 966 }
967 g_free(last_filename); 967 g_free(last_filename);
968 last_filename = g_strdup(file); 968 last_filename = g_strdup(file);
969 969
970 /* cleanup */ 970 /* check for streaming */
971 if (aud_vfs_is_remote(file))
972 {
973 DEBUG(("[crossfade] open_audio: HTTP underrun workaround enabled.\n"));
974 is_http = TRUE;
975 }
976 else
977 is_http = FALSE;
978
971 g_free(file); file = NULL; 979 g_free(file); file = NULL;
972 g_free(title); title = NULL; 980 g_free(title); title = NULL;
973
974 /* check for HTTP streaming */
975 if (config->enable_http_workaround && (0 == strncasecmp(file, "http://", 7)))
976 {
977 DEBUG(("[crossfade] open_audio: HTTP underrun workaround enabled.\n"));
978 is_http = TRUE;
979 }
980 else
981 is_http = FALSE;
982 981
983 /* lock buffer */ 982 /* lock buffer */
984 MUTEX_LOCK(&buffer_mutex); 983 MUTEX_LOCK(&buffer_mutex);
985 984
986 /* reset writer timeout */ 985 /* reset writer timeout */