changeset 9853:765cca786fec

Add netstream A little 10L fix Call control(STREAM_CTRL_RESET) Close stream fd AFTER calling their close function (as some may still need it during close)
author albeu
date Sun, 06 Apr 2003 16:36:17 +0000
parents 47984e3f54ce
children 1446c04b558d
files libmpdemux/stream.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/stream.c	Sun Apr 06 16:36:02 2003 +0000
+++ b/libmpdemux/stream.c	Sun Apr 06 16:36:17 2003 +0000
@@ -62,12 +62,18 @@
 #ifdef HAVE_CDDA
 extern stream_info_t stream_info_cdda;
 #endif
+#ifdef STREAMING
+extern stream_info_t stream_info_netstream;
+#endif
 extern stream_info_t stream_info_file;
 
 stream_info_t* auto_open_streams[] = {
 #ifdef HAVE_CDDA
   &stream_info_cdda,
 #endif
+#ifdef STREAMING
+  &stream_info_netstream,
+#endif
   &stream_info_file,
   NULL
 };
@@ -115,7 +121,7 @@
   if(s->flags & STREAM_SEEK && !s->seek)
     s->flags &= ~STREAM_SEEK;
   if(s->seek && !(s->flags & STREAM_SEEK))
-    s->flags &= STREAM_SEEK;
+    s->flags |= STREAM_SEEK;
   
 
   mp_msg(MSGT_OPEN,MSGL_V, "STREAM: [%s] %s\n",sinfo->name,filename);
@@ -370,6 +376,7 @@
 //    s->buf_pos=s->buf_len=0;
     s->eof=0;
   }
+  if(s->control) s->control(s,STREAM_CTRL_RESET,NULL);
   //stream_seek(s,0);
 }
 
@@ -412,7 +419,6 @@
     shmem_free(s->cache_data);
   }
 #endif
-  if(s->fd>0) close(s->fd);
   switch(s->type) {
 #ifdef LIBSMBCLIENT
   case STREAMTYPE_SMB:
@@ -432,6 +438,7 @@
   default:
     if(s->close) s->close(s);
   }
+  if(s->fd>0) close(s->fd);
   // Disabled atm, i don't like that. s->priv can be anything after all
   // streams should destroy their priv on close
   //if(s->priv) free(s->priv);