mirror of https://github.com/odrling/Aegisub
Remove AegiVideoFrame::cppAlloc, which was only needed by the dshow video provider.
Originally committed to SVN as r3728.
This commit is contained in:
parent
7581d41935
commit
c4d07cb525
|
@ -61,7 +61,6 @@ void AegiVideoFrame::Reset() {
|
|||
// Set properties
|
||||
format = FORMAT_NONE;
|
||||
flipped = false;
|
||||
cppAlloc = true;
|
||||
invertChannels = true;
|
||||
}
|
||||
|
||||
|
@ -126,8 +125,7 @@ void AegiVideoFrame::Allocate() {
|
|||
// Reallocate, if necessary
|
||||
if (memSize != size) {
|
||||
if (data[0]) {
|
||||
if (cppAlloc) delete[] data[0];
|
||||
else free(data[0]);
|
||||
delete[] data[0];
|
||||
}
|
||||
data[0] = new unsigned char[size];
|
||||
for (int i=1;i<4;i++) data[i] = NULL;
|
||||
|
@ -138,20 +136,12 @@ void AegiVideoFrame::Allocate() {
|
|||
data[1] = data[0] + (pitch[0]*height);
|
||||
data[2] = data[0] + (pitch[0]*height+pitch[1]*height/2);
|
||||
}
|
||||
|
||||
// Flag as allocated by C++
|
||||
cppAlloc = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// @brief Clear
|
||||
///
|
||||
void AegiVideoFrame::Clear() {
|
||||
// Free memory
|
||||
if (cppAlloc) delete[] data[0];
|
||||
else free(data[0]);
|
||||
delete[] data[0];
|
||||
|
||||
// Zero variables
|
||||
for (int i=0;i<4;i++) {
|
||||
|
@ -165,7 +155,6 @@ void AegiVideoFrame::Clear() {
|
|||
// Reset properties
|
||||
format = FORMAT_NONE;
|
||||
flipped = false;
|
||||
cppAlloc = true;
|
||||
invertChannels = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,16 +99,12 @@ public:
|
|||
// Pitch, that is, the number of bytes used by each row.
|
||||
unsigned int pitch[4];
|
||||
|
||||
|
||||
/// First row is actually the bottom one
|
||||
bool flipped;
|
||||
|
||||
/// Swap Red and Blue channels or U and V planes (controls RGB versus BGR ordering etc)
|
||||
bool invertChannels;
|
||||
|
||||
/// Allocated with C++'s "new" operator, instead of "malloc"
|
||||
bool cppAlloc;
|
||||
|
||||
AegiVideoFrame();
|
||||
AegiVideoFrame(int width,int height,VideoFrameFormat format=FORMAT_RGB32);
|
||||
|
||||
|
|
|
@ -344,11 +344,6 @@ const AegiVideoFrame AvisynthVideoProvider::GetFrame(int _n) {
|
|||
|
||||
// Aegisub's video frame
|
||||
AegiVideoFrame &final = iframe;
|
||||
final.flipped = false;
|
||||
final.cppAlloc = true;
|
||||
final.invertChannels = false;
|
||||
|
||||
// Format
|
||||
final.format = FORMAT_RGB32;
|
||||
final.flipped = true;
|
||||
final.invertChannels = true;
|
||||
|
|
Loading…
Reference in New Issue