File tree Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Original file line number Diff line number Diff line change @@ -122,9 +122,10 @@ void InputStream::addPacket(const AVPacket& packet)
122
122
return ;
123
123
}
124
124
125
- LOG_DEBUG (" Add a packet data for the stream " << _streamIndex << " to the cache" )
126
- _streamCache.push (CodedData ());
127
- _streamCache.back ().copyData (packet.data , packet.size );
125
+ LOG_DEBUG (" Add a packet data for the stream " << _streamIndex << " to the cache" );
126
+ CodedData codedData;
127
+ codedData.copyData (packet.data , packet.size );
128
+ _streamCache.push (codedData);
128
129
}
129
130
130
131
void InputStream::clearBuffering ()
Original file line number Diff line number Diff line change @@ -540,7 +540,7 @@ StreamTranscoder::~StreamTranscoder()
540
540
{
541
541
for (std::vector<IFrame*>::iterator it = _decodedData.begin (); it != _decodedData.end (); ++it)
542
542
{
543
- delete (*it);
543
+ delete (*it);
544
544
}
545
545
546
546
if (_filteredData != NULL && _filteredData->isDataAllocated ())
Original file line number Diff line number Diff line change
1
+ from nose .tools import *
2
+
3
+ from pyAvTranscoder import avtranscoder as av
4
+
5
+ def testCodedDataConstructors ():
6
+ """
7
+ Try to create a CodedData instances from different constructors.
8
+ """
9
+ dataSize = 1024
10
+ codedData = av .CodedData (dataSize )
11
+ assert_equals (dataSize , codedData .getSize ())
12
+
13
+ codedDataCopy = av .CodedData (codedData )
14
+ assert_equals (dataSize , codedDataCopy .getSize ())
15
+
16
+
17
+ def testCodedDataManagement ():
18
+ """
19
+ Try to resize and assign CodedData data.
20
+ """
21
+ dataSize = 1024
22
+ codedData = av .CodedData ()
23
+ codedData .resize (dataSize )
24
+ assert_equals (dataSize , codedData .getSize ())
25
+
26
+ newDataSize = 128
27
+ codedData .assign (newDataSize , 1 )
28
+ assert_equals (newDataSize , codedData .getSize ())
29
+ data = codedData .getData ()
30
+ for i in range (0 , newDataSize ):
31
+ assert_equals ('\x01 ' , data [i ])
32
+
33
+ newDataSize = 256
34
+ codedData .resize (newDataSize )
35
+ assert_equals (newDataSize , codedData .getSize ())
You can’t perform that action at this time.
0 commit comments