summaryrefslogtreecommitdiff
path: root/indra/media_plugins/quicktime
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-18 10:04:08 +0200
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2009-11-18 10:04:08 +0200
commitda2a0cfceb9fbc7c66f23f8820309f36b6629530 (patch)
tree1a2c93b5d42bc87d79b9b53ea8f38673706d92e6 /indra/media_plugins/quicktime
parent471897cfabbfec8d4dbee65c837d5884310ea61a (diff)
parentc76ab6c4b7384e34a4f32f2fa820b46f6373cdc3 (diff)
Merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/media_plugins/quicktime')
-rw-r--r--indra/media_plugins/quicktime/media_plugin_quicktime.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
index de927de1cd..236f79978d 100644
--- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
+++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp
@@ -528,11 +528,17 @@ private:
if ( ! mMovieController )
return;
- // service QuickTime
- // Calling it this way doesn't have good behavior on Windows...
-// MoviesTask( mMovieHandle, milliseconds );
- // This was the original, but I think using both MoviesTask and MCIdle is redundant. Trying with only MCIdle.
-// MoviesTask( mMovieHandle, 0 );
+ // this wasn't required in 1.xx viewer but we have to manually
+ // work the Windows message pump now
+ #if defined( LL_WINDOWS )
+ MSG msg;
+ while ( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
+ {
+ GetMessage( &msg, NULL, 0, 0 );
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ };
+ #endif
MCIdle( mMovieController );
@@ -712,18 +718,24 @@ private:
// find the size of the title
ByteCount size;
result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
- if ( noErr != result || size <= 0 )
+ if ( noErr != result || size <= 0 /*|| size > 1024 FIXME: arbitrary limit */ )
return false;
// allocate some space and grab it
- UInt8* item_data = new UInt8( size );
- memset( item_data, 0, size * sizeof( UInt8* ) );
+ UInt8* item_data = new UInt8( size + 1 );
+ memset( item_data, 0, ( size + 1 ) * sizeof( UInt8* ) );
result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
if ( noErr != result )
+ {
+ delete [] item_data;
return false;
+ };
// save it
- mMovieTitle = std::string( (char* )item_data );
+ if ( strlen( (char*)item_data ) )
+ mMovieTitle = std::string( (char* )item_data );
+ else
+ mMovieTitle = "";
// clean up
delete [] item_data;