From 79820cba1d1f90dcf9e34403719d77ffb7afc116 Mon Sep 17 00:00:00 2001 From: "rafael@riseup.net" Date: Thu, 16 May 2013 03:36:12 +0000 Subject: [PATCH] fix 503 was right, my mistake in r515... --- darkice/trunk/src/CastSink.cpp | 12 ++------- darkice/trunk/src/CastSink.h | 49 +++++++++------------------------- 2 files changed, 14 insertions(+), 47 deletions(-) diff --git a/darkice/trunk/src/CastSink.cpp b/darkice/trunk/src/CastSink.cpp index 95195e1..aa5c14c 100644 --- a/darkice/trunk/src/CastSink.cpp +++ b/darkice/trunk/src/CastSink.cpp @@ -61,8 +61,7 @@ CastSink :: init ( TcpSocket * socket, const char * name, const char * url, const char * genre, - bool isPublic, - unsigned int bufferDuration ) + bool isPublic ) throw ( Exception ) { this->socket = socket; @@ -73,13 +72,6 @@ CastSink :: init ( TcpSocket * socket, this->url = url ? Util::strDup( url) : 0; this->genre = genre ? Util::strDup( genre) : 0; this->isPublic = isPublic; - this->bufferDuration = bufferDuration; - - int bufferSize = bitRate ? (bitRate * 1024 / 8) * bufferDuration - : (128 * 1024 / 8) * bufferDuration; - - bufferedSink = socket ? new BufferedSink( socket, bufferSize) - : 0; } @@ -118,7 +110,7 @@ CastSink :: open ( void ) throw ( Exception ) return false; } - if ( !bufferedSink->open() ) { + if ( !getSink()->open() ) { return false; } diff --git a/darkice/trunk/src/CastSink.h b/darkice/trunk/src/CastSink.h index f1f5fa0..366e7bc 100644 --- a/darkice/trunk/src/CastSink.h +++ b/darkice/trunk/src/CastSink.h @@ -68,21 +68,11 @@ class CastSink : public Sink, public virtual Reporter */ Ref socket; - /** - * The BufferedSink encapsulating the socket connection to the server. - */ - Ref bufferedSink; - /** * An optional Sink to enable stream dumps. */ Ref streamDump; - /** - * Duration of the BufferedSink buffer in seconds. - */ - unsigned int bufferDuration; - /** * Password to the server. */ @@ -123,8 +113,6 @@ class CastSink : public Sink, public virtual Reporter * @param genre genre of the stream. * @param bitRate bitrate of the stream (e.g. mp3 bitrate). * @param isPublic is the stream public? - * @param bufferDuration duration of the BufferedSink buffer - * in seconds. * @exception Exception */ void @@ -135,8 +123,7 @@ class CastSink : public Sink, public virtual Reporter const char * name, const char * url, const char * genre, - bool isPublic, - unsigned int bufferDuration ) + bool isPublic) throw ( Exception ); /** @@ -178,7 +165,7 @@ class CastSink : public Sink, public virtual Reporter inline Sink * getSink ( void ) const throw () { - return bufferedSink.get(); + return getSocket(); } /** @@ -206,8 +193,7 @@ class CastSink : public Sink, public virtual Reporter * @param bitRate bitrate of the stream (e.g. mp3 bitrate). * @param isPublic is the stream public? * @param streamDump a Sink to dump the streamed binary data to - * @param bufferDuration duration of the BufferedSink buffer - * in seconds. + * * @exception Exception */ inline @@ -218,8 +204,7 @@ class CastSink : public Sink, public virtual Reporter const char * url = 0, const char * genre = 0, bool isPublic = false, - Sink * streamDump = 0, - unsigned int bufferDuration = 10 ) + Sink * streamDump = 0) throw ( Exception ) { init( socket, @@ -229,8 +214,7 @@ class CastSink : public Sink, public virtual Reporter name, url, genre, - isPublic, - bufferDuration ); + isPublic ); } /** @@ -249,8 +233,7 @@ class CastSink : public Sink, public virtual Reporter cs.name, cs.url, cs.genre, - cs.isPublic, - cs.bufferDuration ); + cs.isPublic ); } /** @@ -284,8 +267,7 @@ class CastSink : public Sink, public virtual Reporter cs.name, cs.url, cs.genre, - cs.isPublic, - cs.bufferDuration ); + cs.isPublic ); } return *this; } @@ -308,7 +290,11 @@ class CastSink : public Sink, public virtual Reporter inline virtual bool isOpen ( void ) const throw () { - return bufferedSink != NULL ? bufferedSink->isOpen() : false; + Sink *s = getSink(); + if (s) + return getSink()->isOpen(); + else + return false; } /** @@ -455,17 +441,6 @@ class CastSink : public Sink, public virtual Reporter { return isPublic; } - - /** - * Get the duration of the BufferedSink buffer in seconds. - * - * @return the the duration of the BufferedSink buffer in seconds. - */ - inline unsigned int - getBufferDuration ( void ) const throw () - { - return bufferDuration; - } };