? b.diff ? mvogt@aixd1.rhrk.uni-kl.de ? decoderBaseObject.h ? decoderBaseObject.cc ? b.patch Index: Makefile.am =================================================================== RCS file: /home/kde/kdemultimedia/mpeglib_artsplug/Makefile.am,v retrieving revision 1.4 diff -u -r1.4 Makefile.am --- Makefile.am 2000/07/10 14:14:02 1.4 +++ Makefile.am 2000/08/30 19:53:25 @@ -51,11 +51,11 @@ libarts_mpeglib_la_SOURCES = $(BUILT_SOURCES) \ + decoderBaseObject_impl.cpp \ oggPlayObject_impl.cpp \ mpgPlayObject_impl.cpp \ wavPlayObject_impl.cpp \ - mp3PlayObject_impl.cpp \ - decoderBaseObject_impl.cpp + mp3PlayObject_impl.cpp libarts_mpeglib_la_LDFLAGS = $(all_libraries) \ @@ -81,6 +81,9 @@ -lkmedia2_idl \ -lartsflow_idl \ -lmcop + + + Index: decoderBaseObject_impl.cpp =================================================================== RCS file: /home/kde/kdemultimedia/mpeglib_artsplug/decoderBaseObject_impl.cpp,v retrieving revision 1.11 diff -u -r1.11 decoderBaseObject_impl.cpp --- decoderBaseObject_impl.cpp 2000/08/29 17:12:42 1.11 +++ decoderBaseObject_impl.cpp 2000/08/30 19:53:26 @@ -12,6 +12,7 @@ #include "decoderBaseObject_impl.h" #include "../mpeglib/lib/decoder/decoderPlugin.h" +#include "../mpeglib/lib/splay/splayPlugin.h" // define this to run the playobject without the // arts backend. (usefull to check if a bug is in arts or mpeglib) @@ -40,26 +41,28 @@ DecoderBaseObject_impl::~DecoderBaseObject_impl() { cout << "~DecoderBaseObject_impl -s"<open((char*)filename.c_str()); setStreamState(_THREADSTATE_OPENED); + // we are still in posIdle here outputStream->audioOpen(); @@ -139,7 +143,6 @@ time.seconds=(long)(currentTime); time.ms=(long) (1000.0*(currentTime-(float)time.seconds)); cout << "currentTime :"<setAudioBufferSize(bufferSize); } if(_state == posPlaying) { - /* - * since the samplingrate of the MP3 and the samplingrate of the output - * device (soundcard) are not necessarily the same, it's a bit tricky - */ + // + // since the samplingrate of the MP3 and the samplingrate of the output + // device (soundcard) are not necessarily the same, it's a bit tricky + // // calculate "how fast" we consume input samples (2.0 means, we need 2 // input samples to generate one output sample) @@ -296,13 +299,8 @@ // convert that into bytes and try to read that many bytes wantBytes=(int) (wantWavSamples*byteMultiplikator); - hasBytes=outputStream->read(buffer,wantBytes); + hasBytes=outputStream->read(&buffer,wantBytes); - /* - if (flpos != 0.0) { - cout << "flpos:"<waitStreamState(_OUTPUT_WAIT_METHOD_POLL, @@ -425,14 +423,6 @@ // because of the asyncCommand above. if (decoderPlugin != NULL) { decoderPlugin->close(); - } - - // as long as the decoder is not delete - // we cannot close the Window!!!! - // this demonstrate that it even works _with_ closing the window - // (I hacked it for convinience) - if (outputStream != NULL) { - outputStream->closeWindow(); } Index: decoderBaseObject_impl.h =================================================================== RCS file: /home/kde/kdemultimedia/mpeglib_artsplug/decoderBaseObject_impl.h,v retrieving revision 1.5 diff -u -r1.5 decoderBaseObject_impl.h --- decoderBaseObject_impl.h 2000/08/24 14:52:09 1.5 +++ decoderBaseObject_impl.h 2000/08/30 19:53:26 @@ -37,10 +37,11 @@ class InputStream; class ArtsOutputStream; + using namespace std; using namespace Arts; -class DecoderBaseObject_impl: +class DecoderBaseObject_impl : virtual public Arts::StdSynthModule, virtual public DecoderBaseObject_skel { @@ -61,7 +62,7 @@ virtual ~DecoderBaseObject_impl(); virtual DecoderPlugin* createPlugin(); - virtual InputStream* createInputStream(char* url); + virtual InputStream* createInputStream(const char* url); bool loadMedia(const string &filename); string description(); Index: mpeglibartsplay.cpp =================================================================== RCS file: /home/kde/kdemultimedia/mpeglib_artsplug/mpeglibartsplay.cpp,v retrieving revision 1.5 diff -u -r1.5 mpeglibartsplay.cpp --- mpeglibartsplay.cpp 2000/08/29 17:12:42 1.5 +++ mpeglibartsplay.cpp 2000/08/30 19:53:26 @@ -165,7 +165,6 @@ *play3=server->createPlayObject(filename1); } play3->play(); - usleep(1000); Arts::poTime l_t_zero(0,0,0,"samples"); play3->seek(l_t_zero);