diff --git a/aegisub/src/video_frame.cpp b/aegisub/src/video_frame.cpp index 27eaedb69..6af07a6ab 100644 --- a/aegisub/src/video_frame.cpp +++ b/aegisub/src/video_frame.cpp @@ -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; } diff --git a/aegisub/src/video_frame.h b/aegisub/src/video_frame.h index 728235d6a..6d76fbcfc 100644 --- a/aegisub/src/video_frame.h +++ b/aegisub/src/video_frame.h @@ -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); diff --git a/aegisub/src/video_provider_avs.cpp b/aegisub/src/video_provider_avs.cpp index 193193b0a..1c600297d 100644 --- a/aegisub/src/video_provider_avs.cpp +++ b/aegisub/src/video_provider_avs.cpp @@ -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;