[Jahshaka-cvs] openlibraries/src/openmedialib/plugins/avformat avformat_plugin.cpp, 1.79, 1.80
Status: Beta
Brought to you by:
jahshaka
From: Charles Y. <lil...@us...> - 2007-03-07 14:44:31
|
Update of /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/avformat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17111/plugins/avformat Modified Files: avformat_plugin.cpp Log Message: + Windows... sigh - another attempt at the custom stream reader Index: avformat_plugin.cpp =================================================================== RCS file: /cvsroot/openlibraries/openlibraries/src/openmedialib/plugins/avformat/avformat_plugin.cpp,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- avformat_plugin.cpp 6 Mar 2007 21:32:29 -0000 1.79 +++ avformat_plugin.cpp 7 Mar 2007 14:44:28 -0000 1.80 @@ -2170,7 +2170,7 @@ { int result = 0; priv_stream_handler *priv = new priv_stream_handler; - priv->ptr = plugin::stream_handler_fetch( opl::to_wstring( std::string( filename ) ), flags ); + priv->ptr = plugin::stream_handler_fetch( opl::to_wstring( filename ), flags ); h->priv_data = ( void * )priv; if ( priv && priv->ptr ) { @@ -2188,7 +2188,13 @@ { priv_stream_handler *priv = static_cast< priv_stream_handler * >( h->priv_data ); if ( priv && priv->ptr ) - return priv->ptr->read( buf, size ); + { + opl::string result = priv->ptr->read( size ); + size_t size = result.size( ); + for ( size_t i = 0; i < size; i ++ ) + *buf ++ = result[ i ]; + return size; + } return -1; } |