File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/AvTranscoder/codedStream Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ bool AvInputStream::readNextPacket( CodedData& data )
76
76
if ( ! _streamCache.empty () )
77
77
{
78
78
_streamCache.front ().getBuffer ().swap ( data.getBuffer () );
79
- _streamCache.erase ( _streamCache. begin () );
79
+ _streamCache.pop ( );
80
80
}
81
81
// else read next packet
82
82
else
@@ -94,7 +94,7 @@ void AvInputStream::addPacket( AVPacket& packet )
94
94
return ;
95
95
96
96
CodedData data;
97
- _streamCache.push_back ( data );
97
+ _streamCache.push ( data );
98
98
_streamCache.back ().getBuffer ().resize ( packet.size );
99
99
if ( packet.size != 0 )
100
100
memcpy ( _streamCache.back ().getPtr (), packet.data , packet.size );
@@ -148,7 +148,7 @@ double AvInputStream::getDuration() const
148
148
149
149
void AvInputStream::clearBuffering ()
150
150
{
151
- _streamCache. clear ();
151
+ _streamCache = std::queue<CodedData> ();
152
152
}
153
153
154
154
AVStream* AvInputStream::getAVStream () const
Original file line number Diff line number Diff line change 3
3
4
4
#include " IInputStream.hpp"
5
5
6
+ #include < queue>
7
+
6
8
struct AVStream ;
7
9
8
10
namespace avtranscoder
@@ -45,7 +47,7 @@ class AvExport AvInputStream : public IInputStream
45
47
InputFile* _inputFile; // /< Has link (no ownership)
46
48
ICodec* _codec; // /< Has ownership
47
49
48
- std::vector <CodedData> _streamCache;
50
+ std::queue <CodedData> _streamCache;
49
51
50
52
size_t _streamIndex; // /< Index of the stream in the input file
51
53
bool _bufferized; // /< If the stream is bufferized
You can’t perform that action at this time.
0 commit comments