Skip to content

Commit 11789bb

Browse files
author
Clement Champetier
committed
frames: rename local variables to log messages
1 parent 93ce328 commit 11789bb

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/AvTranscoder/data/decoded/AudioFrame.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ void AudioFrame::allocateData()
113113
if(ret < 0)
114114
{
115115
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())
124124
throw std::bad_alloc();
125125
}
126126
_dataAllocated = true;
@@ -139,9 +139,9 @@ void AudioFrame::assignBuffer(const unsigned char* ptrValue)
139139
getNbSamplesPerChannel(), getSampleFormat(), align);
140140
if(ret < 0)
141141
{
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());
145145
}
146146
}
147147

src/AvTranscoder/data/decoded/VideoFrame.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ void VideoFrame::allocateData()
9393
if(ret < 0)
9494
{
9595
const std::string formatName = getPixelFormatName(_desc._pixelFormat);
96-
std::stringstream stream;
97-
stream << "Unable to allocate an image frame of ";
98-
stream << "width = " << _frame->width << ", ";
99-
stream << "height = " << _frame->height << ", ";
100-
stream << "pixel format = " << (formatName.empty() ? "none" : formatName);
101-
LOG_ERROR(stream.str())
96+
std::stringstream msg;
97+
msg << "Unable to allocate an image frame of ";
98+
msg << "width = " << _frame->width << ", ";
99+
msg << "height = " << _frame->height << ", ";
100+
msg << "pixel format = " << (formatName.empty() ? "none" : formatName);
101+
LOG_ERROR(msg.str())
102102
throw std::bad_alloc();
103103
}
104104
_dataAllocated = true;
@@ -116,9 +116,9 @@ void VideoFrame::assignBuffer(const unsigned char* ptrValue)
116116
avpicture_fill(reinterpret_cast<AVPicture*>(_frame), ptrValue, getPixelFormat(), getWidth(), getHeight());
117117
if(ret < 0)
118118
{
119-
std::stringstream os;
120-
os << "Unable to assign an image buffer of " << getSize() << " bytes: " << getDescriptionFromErrorCode(ret);
121-
throw std::runtime_error(os.str());
119+
std::stringstream msg;
120+
msg << "Unable to assign an image buffer of " << getSize() << " bytes: " << getDescriptionFromErrorCode(ret);
121+
throw std::runtime_error(msg.str());
122122
}
123123
}
124124
}

0 commit comments

Comments
 (0)