summaryrefslogtreecommitdiffstats
path: root/libmpdemux/stream.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-06 18:03:12 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-06 18:03:12 +0000
commit632b8e8edd707085a9981b4edec7c38b71199cfd (patch)
tree5dd123cb7e732abd3e31ff1e322802bfbbf9121e /libmpdemux/stream.c
parenta5eea66f78c7b30773399b29563f917a577cb543 (diff)
downloadmpv-632b8e8edd707085a9981b4edec7c38b71199cfd.tar.bz2
mpv-632b8e8edd707085a9981b4edec7c38b71199cfd.tar.xz
smb:// (samba client) support by Vladimir Moushkov <vlindos_mpdev@abv.bg>
TODO: add libsmb* detection and #define LIBSMBCLIENT to ./configure ! git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7631 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/stream.c')
-rw-r--r--libmpdemux/stream.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libmpdemux/stream.c b/libmpdemux/stream.c
index 3d366ee312..01e961bf2c 100644
--- a/libmpdemux/stream.c
+++ b/libmpdemux/stream.c
@@ -44,12 +44,21 @@ void seek_cdda(stream_t* s);
void close_cdda(stream_t* s);
#endif
+#ifdef LIBSMBCLIENT
+#include "libsmbclient.h"
+#endif
+
//=================== STREAMER =========================
int stream_fill_buffer(stream_t *s){
int len;
if(s->eof){ s->buf_pos=s->buf_len=0; return 0; }
switch(s->type){
+#ifdef LIBSMBCLIENT
+ case STREAMTYPE_SMB:
+ len=smbc_read(s->fd,s->buffer,STREAM_BUFFER_SIZE);
+ break;
+#endif
case STREAMTYPE_FILE:
case STREAMTYPE_STREAM:
case STREAMTYPE_PLAYLIST:
@@ -110,6 +119,7 @@ off_t newpos=0;
switch(s->type){
case STREAMTYPE_FILE:
+ case STREAMTYPE_SMB:
case STREAMTYPE_STREAM:
#ifdef _LARGEFILE_SOURCE
newpos=pos&(~((long long)STREAM_BUFFER_SIZE-1));break;
@@ -140,6 +150,12 @@ if(newpos==0 || newpos!=s->pos){
s->pos=newpos; // real seek
if(lseek(s->fd,s->pos,SEEK_SET)<0) s->eof=1;
break;
+#ifdef LIBSMBCLIENT
+ case STREAMTYPE_SMB:
+ s->pos=newpos; // real seek
+ if(smbc_lseek(s->fd,s->pos,SEEK_SET)<0) s->eof=1;
+ break;
+#endif
#ifdef HAVE_VCD
case STREAMTYPE_VCD:
s->pos=newpos; // real seek
@@ -267,6 +283,11 @@ void free_stream(stream_t *s){
}
if(s->fd>0) close(s->fd);
switch(s->type) {
+#ifdef LIBSMBCLIENT
+ case STREAMTYPE_SMB:
+ smbc_close(s->fd);
+ break;
+#endif
#ifdef HAVE_CDDA
case STREAMTYPE_CDDA:
close_cdda(s);