@@ -113,14 +113,14 @@ void AudioFrame::allocateData()
113
113
if (ret < 0 )
114
114
{
115
115
const std::string formatName = getSampleFormatName (_desc._sampleFormat );
116
- std::stringstream stream ;
117
- stream << " Unable to allocate an audio frame of " ;
118
- stream << " sample rate = " << _frame->sample_rate << " , " ;
119
- stream << " nb channels = " << _frame->channels << " , " ;
120
- stream << " channel layout = " << av_get_channel_name (_frame->channels ) << " , " ;
121
- stream << " nb samples = " << _frame->nb_samples << " , " ;
122
- stream << " sample format = " << (formatName.empty () ? " none" : formatName);
123
- LOG_ERROR (stream .str ())
116
+ std::stringstream msg ;
117
+ msg << " Unable to allocate an audio frame of " ;
118
+ msg << " sample rate = " << _frame->sample_rate << " , " ;
119
+ msg << " nb channels = " << _frame->channels << " , " ;
120
+ msg << " channel layout = " << av_get_channel_name (_frame->channels ) << " , " ;
121
+ msg << " nb samples = " << _frame->nb_samples << " , " ;
122
+ msg << " sample format = " << (formatName.empty () ? " none" : formatName);
123
+ LOG_ERROR (msg .str ())
124
124
throw std::bad_alloc ();
125
125
}
126
126
_dataAllocated = true ;
@@ -139,9 +139,9 @@ void AudioFrame::assignBuffer(const unsigned char* ptrValue)
139
139
getNbSamplesPerChannel (), getSampleFormat (), align);
140
140
if (ret < 0 )
141
141
{
142
- std::stringstream os ;
143
- os << " Unable to assign an audio buffer: " << getDescriptionFromErrorCode (ret);
144
- throw std::runtime_error (os .str ());
142
+ std::stringstream msg ;
143
+ msg << " Unable to assign an audio buffer: " << getDescriptionFromErrorCode (ret);
144
+ throw std::runtime_error (msg .str ());
145
145
}
146
146
}
147
147
0 commit comments