@@ -101,11 +101,11 @@ IOutputStream& OutputFile::addDataStream( const DataCodec& dataDesc )
101
101
return *outputStream;
102
102
}
103
103
104
- IOutputStream& OutputFile::getStream ( const size_t streamId )
104
+ IOutputStream& OutputFile::getStream ( const size_t streamIndex )
105
105
{
106
- if ( streamId >= _outputStreams.size () )
106
+ if ( streamIndex >= _outputStreams.size () )
107
107
throw std::runtime_error ( " unable to get output stream (out of range)" );
108
- return *_outputStreams.at ( streamId );
108
+ return *_outputStreams.at ( streamIndex );
109
109
}
110
110
111
111
std::string OutputFile::getFilename () const
@@ -159,16 +159,16 @@ bool OutputFile::beginWrap( )
159
159
return true ;
160
160
}
161
161
162
- IOutputStream::EWrappingStatus OutputFile::wrap ( const CodedData& data, const size_t streamId )
162
+ IOutputStream::EWrappingStatus OutputFile::wrap ( const CodedData& data, const size_t streamIndex )
163
163
{
164
164
if ( ! data.getSize () )
165
165
return IOutputStream::eWrappingSuccess;
166
166
167
- LOG_DEBUG ( " Wrap on stream " << streamId << " (" << data.getSize () << " bytes for frame " << _frameCount.at ( streamId ) << " )" )
167
+ LOG_DEBUG ( " Wrap on stream " << streamIndex << " (" << data.getSize () << " bytes for frame " << _frameCount.at ( streamIndex ) << " )" )
168
168
169
169
AVPacket packet;
170
170
av_init_packet ( &packet );
171
- packet.stream_index = streamId ;
171
+ packet.stream_index = streamIndex ;
172
172
packet.data = (uint8_t *)data.getData ();
173
173
packet.size = data.getSize ();
174
174
@@ -177,15 +177,15 @@ IOutputStream::EWrappingStatus OutputFile::wrap( const CodedData& data, const si
177
177
// free packet.side_data, set packet.data to NULL and packet.size to 0
178
178
av_free_packet ( &packet );
179
179
180
- const double currentStreamDuration = _outputStreams.at ( streamId )->getStreamDuration ();
180
+ const double currentStreamDuration = _outputStreams.at ( streamIndex )->getStreamDuration ();
181
181
if ( currentStreamDuration < _previousProcessedStreamDuration )
182
182
{
183
183
// if the current stream is strictly shorter than the previous, wait for more data
184
184
return IOutputStream::eWrappingWaitingForData;
185
185
}
186
186
187
187
_previousProcessedStreamDuration = currentStreamDuration;
188
- _frameCount.at ( streamId )++;
188
+ _frameCount.at ( streamIndex )++;
189
189
190
190
return IOutputStream::eWrappingSuccess;
191
191
}
0 commit comments