From be72748d2a69ddda51c4b41c0c8f2beba077b265 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 13 Nov 2009 11:03:39 -0800 Subject: Fix for DEV-42152 (Streaming media broken on QuickTime) --- indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/media_plugins/quicktime') diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index de927de1cd..dac0509531 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 ); -- cgit v1.2.3 From 18eab4a02675195c6498ca7b0982e62f0ddf9e60 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 16 Nov 2009 18:42:35 -0800 Subject: Merge with tip --- indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'indra/media_plugins/quicktime') diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index dac0509531..182fab69d0 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -552,7 +552,7 @@ private: processState(); // see if title arrived and if so, update member variable with contents - checkTitle(); + //checkTitle(); // QT call to see if we are at the end - can't do with controller if ( IsMovieDone( mMovieHandle ) ) @@ -718,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; -- cgit v1.2.3 From ac9963ade2d8a70408f021581e44691285241bd1 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 16 Nov 2009 19:22:45 -0800 Subject: Fix for - DEV-42713 (Playing MP3s crash the QuickTime plugin) Note: This was fixed earlier in checkTitle() bosy and checked in by mistake. This checkin re-enables the title grabbing code. --- indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/media_plugins/quicktime') diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 182fab69d0..7148edda5c 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -552,7 +552,7 @@ private: processState(); // see if title arrived and if so, update member variable with contents - //checkTitle(); + checkTitle(); // QT call to see if we are at the end - can't do with controller if ( IsMovieDone( mMovieHandle ) ) -- cgit v1.2.3 From 18980efe16e19ab0562267e10ec55bed55b581fb Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 16 Nov 2009 19:49:45 -0800 Subject: Fix up line endings issues. --- indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/media_plugins/quicktime') diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 7148edda5c..f4add536eb 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -531,13 +531,13 @@ private: // 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 ); - }; + MSG msg; + while ( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) + { + GetMessage( &msg, NULL, 0, 0 ); + TranslateMessage( &msg ); + DispatchMessage( &msg ); + }; #endif MCIdle( mMovieController ); -- cgit v1.2.3 From ccc72757ef23fa7ffba066e5bdaf05e3f8a95cca Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 16 Nov 2009 22:25:40 -0800 Subject: Fix comment-in-comment that was breaking Mac build. --- indra/media_plugins/quicktime/media_plugin_quicktime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/media_plugins/quicktime') diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index f4add536eb..236f79978d 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -718,7 +718,7 @@ private: // find the size of the title ByteCount size; result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size ); - if ( noErr != result || size <= 0 /*|| size > 1024 /* FIXME: arbitrary limit */ ) + if ( noErr != result || size <= 0 /*|| size > 1024 FIXME: arbitrary limit */ ) return false; // allocate some space and grab it -- cgit v1.2.3