[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    [PATCH] changed file reading again
From:       Martin Vogt <mvogt () rhrk ! uni-kl ! de>
Date:       2000-08-31 13:39:38
[Download RAW message or body]

Hi,

the file reading code did look nice and there was a bug
in the divxplugin which is now fixed.

Martin


["a.diff" (text/plain)]

? a.patch
? a.diff
Index: lib/input/fileInputStream.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/mpeglib/lib/input/fileInputStream.cpp,v
retrieving revision 1.4
diff -u -r1.4 fileInputStream.cpp
--- lib/input/fileInputStream.cpp	2000/08/30 23:16:05	1.4
+++ lib/input/fileInputStream.cpp	2000/08/31 13:35:35
@@ -98,7 +98,14 @@
   if (isOpen()==false){
     return true;
   }
-  return false;
+  int back=true;
+  lockFile();
+  if (file != NULL) {
+    back=feof(file);
+  }
+  unlockFile();
+
+  return back;
 }
 
 
@@ -110,13 +117,8 @@
       return 0;
     }
     lockFile();
-    int fd=-1;
     if (file != NULL) {
-      fd=fileno(file);
-    }
-    bytesRead=::read(fd,ptr,size);
-    if (bytesRead == 0) {
-      lopen=false;
+      bytesRead=fread(ptr,1,size,file);
     }
     unlockFile();
   } else {
@@ -133,16 +135,14 @@
 
 int FileInputStream::seek(long posInBytes) {
   int back=true;
-  long pos;
   if (isOpen()==false) {
     return false;
   }
   lockFile();
-  int fd=-1;
+  long pos=-1;
   if (file != NULL) {
-    fd=fileno(file);
+    pos=fseek(file,posInBytes,SEEK_SET);
   }
-  pos=lseek(fd,posInBytes,SEEK_SET);
   unlockFile();
 
   if (pos < 0) {
Index: lib/mpgplayer/mpegStreamPlayer.cpp
===================================================================
RCS file: /home/kde/kdemultimedia/mpeglib/lib/mpgplayer/mpegStreamPlayer.cpp,v
retrieving revision 1.4
diff -u -r1.4 mpegStreamPlayer.cpp
--- lib/mpgplayer/mpegStreamPlayer.cpp	2000/08/30 20:23:32	1.4
+++ lib/mpgplayer/mpegStreamPlayer.cpp	2000/08/31 13:35:35
@@ -43,11 +43,15 @@
   /**
      here we set the plugins in autoPlay mode.
      because we handle all commands over the loopback buffer.
+     This is necessary, because on start we send play()
+     but this does not mean that we already have
+     build this class (divxplugin for example)
+     See this switch as an implicit play command
   */
-  /*
+
   audioDecoder->config("-y","on",NULL);
   videoDecoder->config("-y","on",NULL);
-  */
+
 
   audioInput=new BufferInputStream(1024*_BUFFER_CHUNK_SIZE,
 				   1024*200,"audioInput");

_______________________________________________
Kde-multimedia mailing list
Kde-multimedia@master.kde.org
http://master.kde.org/mailman/listinfo/kde-multimedia


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic