aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia')
-rw-r--r--linden/indra/llmedia/llmediaimplcommon.cpp1
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp3
-rw-r--r--linden/indra/llmedia/llmediaimplllmozlib.cpp6
-rw-r--r--linden/indra/llmedia/llmediaimplquicktime.cpp10
-rw-r--r--linden/indra/llmedia/llmediaobserver.h8
5 files changed, 20 insertions, 8 deletions
diff --git a/linden/indra/llmedia/llmediaimplcommon.cpp b/linden/indra/llmedia/llmediaimplcommon.cpp
index a0705bb..abb61e1 100644
--- a/linden/indra/llmedia/llmediaimplcommon.cpp
+++ b/linden/indra/llmedia/llmediaimplcommon.cpp
@@ -52,6 +52,7 @@
52LLMediaImplCommon::LLMediaImplCommon() : 52LLMediaImplCommon::LLMediaImplCommon() :
53 mMimeType( std::string() ), 53 mMimeType( std::string() ),
54 mInitialURL( std::string() ), 54 mInitialURL( std::string() ),
55 mImplMaker( NULL ),
55 mAutoScaled( false ), 56 mAutoScaled( false ),
56 mMediaWidth( 0 ), 57 mMediaWidth( 0 ),
57 mMediaPrevWidth( 0 ), 58 mMediaPrevWidth( 0 ),
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 8b0363a..5bf30d9 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -186,7 +186,8 @@ startup ( LLMediaManagerData* init_data )
186 WARNMSG("gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart."); 186 WARNMSG("gst_segtrap_set_enabled() is not available; Automated crash-reporter may cease to function until next restart.");
187 187
188 // Protect against GStreamer resetting the locale, yuck. 188 // Protect against GStreamer resetting the locale, yuck.
189 std::string saved_locale = setlocale(LC_ALL, NULL); 189 static std::string saved_locale;
190 saved_locale = setlocale(LC_ALL, NULL);
190 if (0 == llgst_init_check(NULL, NULL, NULL)) 191 if (0 == llgst_init_check(NULL, NULL, NULL))
191 { 192 {
192 WARNMSG("GST init failed for unspecified reason."); 193 WARNMSG("GST init failed for unspecified reason.");
diff --git a/linden/indra/llmedia/llmediaimplllmozlib.cpp b/linden/indra/llmedia/llmediaimplllmozlib.cpp
index 53cb344..9e2564a 100644
--- a/linden/indra/llmedia/llmediaimplllmozlib.cpp
+++ b/linden/indra/llmedia/llmediaimplllmozlib.cpp
@@ -94,7 +94,8 @@ bool LLMediaImplLLMozLib::startup( LLMediaManagerData* init_data )
94 // the locale to protect it, as exotic/non-C locales 94 // the locale to protect it, as exotic/non-C locales
95 // causes our code lots of general critical weirdness 95 // causes our code lots of general critical weirdness
96 // and crashness. (SL-35450) 96 // and crashness. (SL-35450)
97 std::string saved_locale = setlocale(LC_ALL, NULL); 97 static std::string saved_locale;
98 saved_locale = setlocale(LC_ALL, NULL);
98#endif // LL_LINUX 99#endif // LL_LINUX
99 100
100 bool result = LLMozLib::getInstance()->init( init_data->getBrowserApplicationDir(), 101 bool result = LLMozLib::getInstance()->init( init_data->getBrowserApplicationDir(),
@@ -132,7 +133,8 @@ bool LLMediaImplLLMozLib::init()
132 return false; 133 return false;
133 134
134#if LL_LINUX 135#if LL_LINUX
135 std::string saved_locale = setlocale(LC_ALL, NULL); 136 static std::string saved_locale;
137 saved_locale = setlocale(LC_ALL, NULL);
136#endif // LL_LINUX 138#endif // LL_LINUX
137 139
138 mWindowId = LLMozLib::getInstance()->createBrowserWindow( mBrowserWindowWidth, mBrowserWindowHeight ); 140 mWindowId = LLMozLib::getInstance()->createBrowserWindow( mBrowserWindowWidth, mBrowserWindowHeight );
diff --git a/linden/indra/llmedia/llmediaimplquicktime.cpp b/linden/indra/llmedia/llmediaimplquicktime.cpp
index b126e2f..8f7686d 100644
--- a/linden/indra/llmedia/llmediaimplquicktime.cpp
+++ b/linden/indra/llmedia/llmediaimplquicktime.cpp
@@ -116,11 +116,19 @@ bool LLMediaImplQuickTime::load( const std::string url )
116 if ( url.empty() ) 116 if ( url.empty() )
117 return false; 117 return false;
118 118
119 //In case std::string::c_str() makes a copy of the url data,
120 //make sure there is memory to hold it before allocating memory for handle.
121 //if fails, NewHandleClear(...) should return NULL.
122 const char* url_string = url.c_str() ;
119 Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) ); 123 Handle handle = NewHandleClear( ( Size )( url.length() + 1 ) );
120 if ( NULL == handle ) 124 if ( NULL == handle )
121 return false; 125 return false;
126 if(noErr != MemError() || NULL == *handle)
127 {
128 return false ;
129 }
122 130
123 BlockMove( url.c_str(), *handle, ( Size )( url.length() + 1 ) ); 131 BlockMove( url_string, *handle, ( Size )( url.length() + 1 ) );
124 132
125 //std::cout << "LLMediaImplQuickTime::load( " << url << " )" << std::endl; 133 //std::cout << "LLMediaImplQuickTime::load( " << url << " )" << std::endl;
126 134
diff --git a/linden/indra/llmedia/llmediaobserver.h b/linden/indra/llmedia/llmediaobserver.h
index ec9f881..079cb29 100644
--- a/linden/indra/llmedia/llmediaobserver.h
+++ b/linden/indra/llmedia/llmediaobserver.h
@@ -38,22 +38,22 @@ class LLMediaEvent
38{ 38{
39 public: 39 public:
40 LLMediaEvent( LLMediaBase* subject ) : 40 LLMediaEvent( LLMediaBase* subject ) :
41 mSubject( subject ) 41 mSubject( subject ), mIntValue(-1)
42 { 42 {
43 }; 43 };
44 44
45 LLMediaEvent( LLMediaBase* subject, std::string in ) : 45 LLMediaEvent( LLMediaBase* subject, std::string in ) :
46 mSubject( subject ), mStringValue(in) 46 mSubject( subject ), mIntValue(-1), mStringValue(in)
47 { 47 {
48 }; 48 };
49 49
50 LLMediaEvent( LLMediaBase* subject, std::string string_in, std::string string_ex_in ) : 50 LLMediaEvent( LLMediaBase* subject, std::string string_in, std::string string_ex_in ) :
51 mSubject( subject ), mStringValue(string_in), mStringValueEx(string_ex_in) 51 mSubject( subject ), mIntValue(-1), mStringValue(string_in), mStringValueEx(string_ex_in)
52 { 52 {
53 }; 53 };
54 54
55 LLMediaEvent( LLMediaBase* subject, std::string string_in, int int_in ) : 55 LLMediaEvent( LLMediaBase* subject, std::string string_in, int int_in ) :
56 mSubject( subject ), mStringValue(string_in), mIntValue(int_in) 56 mSubject( subject ), mIntValue(int_in), mStringValue(string_in)
57 { 57 {
58 }; 58 };
59 59