Package: xmms
Version: 1.2.10+20061001-3

When enabling 'Save stream to disk' the previously saved file gets
overwritten. It is really annoying, especially if the saving suddenly
restarts because of lost connection, for example. But even during
normal operation it is a hassle to renaming the file all the time.

The mp3 stream saving does the right thing, so I just changed the
vorbis/http.c code accordingly, see the attached diff.

Lipi
549c549,551
< 		gchar *output_name;
---
> 		gchar *output_name, *fname, *temp;
>         int i = 1;
> 
551,554c553,556
< 		output_name = file;
< 		if (!strncasecmp(output_name, "http://";, 7))
< 			output_name += 7;
< 		temp = strrchr(output_name, '.');
---
> 		fname = file;
> 		if (!strncasecmp(fname, "http://";, 7))
> 			fname += 7;
> 		temp = strrchr(fname, '.');
558c560
< 		while ((temp = strchr(output_name, '/')))
---
> 		while ((temp = strchr(fname, '/')))
560c562,570
< 		output_name = g_strdup_printf("%s/%s.ogg", vorbis_cfg.save_http_path, output_name);
---
> 		output_name = g_strdup_printf("%s/%s.ogg",
>                                       vorbis_cfg.save_http_path, fname);
> 		while (!access(output_name, F_OK) && i < 100000)
> 		{
> 			g_free(output_name);
> 			output_name = g_strdup_printf("%s/%s-%d.ogg",
> 						      vorbis_cfg.save_http_path,
> 						      fname, i++);
> 		}

Reply via email to