Index: include/libroar/vio_dstr.h
===================================================================
--- include/libroar/vio_dstr.h	(revision 4956)
+++ include/libroar/vio_dstr.h	(revision 5227)
@@ -197,6 +197,6 @@
 int     roar_vio_open_default (struct roar_vio_calls * calls, struct roar_vio_defaults * def, char * opts);
 
-int     roar_vio_open_dstr    (struct roar_vio_calls * calls, char * dstr, struct roar_vio_defaults * def, int dnum);
-int     roar_vio_open_dstr_vio(struct roar_vio_calls * calls, char * dstr, struct roar_vio_defaults * def, int dnum, struct roar_vio_calls * vio);
+int     roar_vio_open_dstr    (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum);
+int     roar_vio_open_dstr_vio(struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum, struct roar_vio_calls * vio);
 
 int     roar_vio_dstr_parse_opts(struct roar_vio_dstr_chain * chain);
Index: include/libroar/vs.h
===================================================================
--- include/libroar/vs.h	(revision 5109)
+++ include/libroar/vs.h	(revision 5227)
@@ -79,9 +79,9 @@
 /* Open a file and attach it.
  */
-int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
+int roar_vs_file_simple(roar_vs_t * vss, const char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(1, 2);
 
 /* Connects to a server to just play a file.
  */
-roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(3);
+roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, const char * filename, int * error) _LIBROAR_ATTR_USE_RESULT _LIBROAR_ATTR_NONNULL(3);
 
 /* Switch to buffered mode.
Index: libroar/vio_dstr.c
===================================================================
--- libroar/vio_dstr.c	(revision 4984)
+++ libroar/vio_dstr.c	(revision 5227)
@@ -360,15 +360,16 @@
 #endif
 
-int     roar_vio_open_dstr    (struct roar_vio_calls * calls, char * dstr, struct roar_vio_defaults * def, int dnum) {
+int     roar_vio_open_dstr    (struct roar_vio_calls * calls, const char * dstr, struct roar_vio_defaults * def, int dnum) {
  return roar_vio_open_dstr_vio(calls, dstr, def, dnum, NULL);
 }
 
-#define _ret(x) do { int _err = roar_error; roar_mm_free(dstr); roar_error = _err; roar_err_to_errno(); return (x); } while (0)
+#define _ret(x) do { int _err = roar_error; roar_mm_free(dstr_copy); roar_error = _err; roar_err_to_errno(); return (x); } while (0)
 
 int     roar_vio_open_dstr_vio(struct roar_vio_calls * calls,
-                               char * dstr, struct roar_vio_defaults * def, int dnum,
+                               const char * dstr, struct roar_vio_defaults * def, int dnum,
                                struct roar_vio_calls * vio) {
 #ifndef ROAR_WITHOUT_VIO_DSTR
  struct roar_vio_dstr_chain chain[ROAR_VIO_DSTR_MAX_OBJ_PER_CHAIN];
+ char * dstr_copy;
  char * next;
  char * this;
@@ -387,5 +388,5 @@
   return -1;
 
- if ( (dstr = roar_mm_strdup(dstr)) == NULL )
+ if ( (dstr_copy = roar_mm_strdup(dstr)) == NULL )
   return -1;
 
@@ -394,5 +395,5 @@
  chain[0].type = ROAR_VIO_DSTR_OBJT_INTERNAL;
 
- next = dstr;
+ next = dstr_copy;
 
  while (next != NULL) {
Index: libroar/vs.c
===================================================================
--- libroar/vs.c	(revision 5199)
+++ libroar/vs.c	(revision 5227)
@@ -408,5 +408,5 @@
 }
 
-int roar_vs_file_simple(roar_vs_t * vss, char * filename, int * error) {
+int roar_vs_file_simple(roar_vs_t * vss, const char * filename, int * error) {
  struct roar_vio_defaults def;
  struct roar_vio_calls * file;
@@ -495,5 +495,5 @@
 }
 
-roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, char * filename, int * error) {
+roar_vs_t * roar_vs_new_from_file(const char * server, const char * name, const char * filename, int * error) {
  roar_vs_t * vss = roar_vs_new(server, name, error);
 
