diff options
author | phintuka <phintuka> | 2007-06-21 09:49:57 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-06-21 09:49:57 +0000 |
commit | ef2952ec2fc15c98365cfa19d8866773107df861 (patch) | |
tree | 99f038ca19c33ace60e836e77bee9b3e33283596 | |
parent | 4f741f59fed1db97418d54914bc5f030fc310822 (diff) | |
download | xineliboutput-ef2952ec2fc15c98365cfa19d8866773107df861.tar.gz xineliboutput-ef2952ec2fc15c98365cfa19d8866773107df861.tar.bz2 |
char *m_FileName -> cString m_FileName
-rw-r--r-- | frontend.c | 11 | ||||
-rw-r--r-- | frontend.h | 4 | ||||
-rw-r--r-- | frontend_svr.c | 12 |
3 files changed, 10 insertions, 17 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.36 2007-06-12 19:28:37 phintuka Exp $ + * $Id: frontend.c,v 1.37 2007-06-21 09:49:57 phintuka Exp $ * */ @@ -190,7 +190,6 @@ cXinelibThread::cXinelibThread(const char *Description) : cThread(Description) m_Frames = 0; m_bEndOfStreamReached = false; m_bPlayingFile = false; - m_FileName = NULL; } cXinelibThread::~cXinelibThread() @@ -200,8 +199,6 @@ cXinelibThread::~cXinelibThread() m_bStopThread = true; if(Active()) Cancel(); - if(m_FileName) - free(m_FileName); } // @@ -674,9 +671,7 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, if(FileName) { Lock(); - if(m_FileName) - free(m_FileName); - m_FileName = strdup(FileName); + m_FileName = FileName; m_bPlayingFile = true; Unlock(); } @@ -686,8 +681,6 @@ bool cXinelibThread::PlayFile(const char *FileName, int Position, if(!FileName || result != 0) { Lock(); m_bPlayingFile = false; - if(m_FileName) - free(m_FileName); m_FileName = NULL; Unlock(); } else { @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.h,v 1.14 2007-04-12 22:53:36 phintuka Exp $ + * $Id: frontend.h,v 1.15 2007-06-21 09:49:57 phintuka Exp $ * */ @@ -138,7 +138,7 @@ class cXinelibThread : public cThread, public cListObject bool m_bLiveMode; bool m_bEndOfStreamReached; bool m_bPlayingFile; - char *m_FileName; + cString m_FileName; uint64_t m_StreamPos; uint32_t m_Frames; }; diff --git a/frontend_svr.c b/frontend_svr.c index 9774fc10..d1123bb0 100644 --- a/frontend_svr.c +++ b/frontend_svr.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend_svr.c,v 1.44 2007-06-11 19:39:06 phintuka Exp $ + * $Id: frontend_svr.c,v 1.45 2007-06-21 09:49:57 phintuka Exp $ * */ @@ -791,7 +791,7 @@ int cXinelibServer::PlayFileCtrl(const char *Cmd) } bool result = cXinelibThread::PlayFileCtrl(Cmd); - if(!m_FileName) + if(!*m_FileName) cHttpStreamer::CloseAll(); return result; } @@ -1175,13 +1175,13 @@ void cXinelibServer::Handle_Control_CONFIG(int cli) ConfigurePostprocessing("headphone", xc.headphone ? true : false, NULL); #endif - if(m_bPlayingFile && m_FileName) { + if(m_bPlayingFile && *m_FileName) { Unlock(); int pos = cXinelibDevice::Instance().PlayFileCtrl("GETPOS"); Lock(); - if(m_bPlayingFile && m_FileName) { + if(m_bPlayingFile && *m_FileName) { fd_control[cli].printf("PLAYFILE %d %s %s\r\n", - (pos>0?pos/1000:0), xc.audio_visualization, m_FileName); + (pos>0?pos/1000:0), xc.audio_visualization, *m_FileName); } } } @@ -1345,7 +1345,7 @@ void cXinelibServer::Handle_Control_HTTP(int cli, const char *arg) // currently playing media file // else if(!strncmp(m_State[cli]->Uri(), "/PLAYFILE", 9)) { - if( m_FileName && m_bPlayingFile) { + if( *m_FileName && m_bPlayingFile) { LOGMSG("HTTP streaming media file"); // detach socket |