diff options
author | phintuka <phintuka> | 2007-06-21 12:40:22 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-06-21 12:40:22 +0000 |
commit | 153098be82e66f23e16a7847a84743ee090f3f0c (patch) | |
tree | 43cbb951b1e73220fb5a5d5a3f945c58dc84bea6 | |
parent | 551c68118286051bd1785ad3f0c02e1d3ab77308 (diff) | |
download | xineliboutput-153098be82e66f23e16a7847a84743ee090f3f0c.tar.gz xineliboutput-153098be82e66f23e16a7847a84743ee090f3f0c.tar.bz2 |
Properly escape filenames before sending to xine
Add external subtitle file directly to mrl
-rw-r--r-- | media_player.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/media_player.c b/media_player.c index 93c6da6b..46adb0b3 100644 --- a/media_player.c +++ b/media_player.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: media_player.c,v 1.30 2007-06-21 09:19:56 phintuka Exp $ + * $Id: media_player.c,v 1.31 2007-06-21 12:40:22 phintuka Exp $ * */ @@ -239,7 +239,15 @@ void cXinelibPlayer::Activate(bool On) pos = 0; close(fd); } - m_Replaying = cXinelibDevice::Instance().PlayFile(m_File, pos); + // escape file name and join subtitle file + // Maybe mrls from playlist files should not be escaped ? + // (those may contain #subtitle, #volnorm etc. directives) + cString mrl; + if(*m_SubFile) + mrl = cString::sprintf("%s#subtitle:%s", *cPlaylist::EscapeMrl(m_File), *cPlaylist::EscapeMrl(m_SubFile)); + else /*if((*m_File)[0] == '/')*/ + mrl = cPlaylist::EscapeMrl(m_File); + m_Replaying = cXinelibDevice::Instance().PlayFile(mrl, pos); LOGDBG("cXinelibPlayer playing %s (%s)", *m_File, m_Replaying?"OK":"FAIL"); if(m_Replaying) { |