File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
src/AvTranscoder/data/decoded Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -34,19 +34,7 @@ void Frame::operator=(const Frame& otherFrame)
34
34
35
35
Frame::~Frame ()
36
36
{
37
- if (_frame != NULL )
38
- {
39
- #if LIBAVCODEC_VERSION_MAJOR > 54
40
- av_frame_free (&_frame);
41
- #else
42
- #if LIBAVCODEC_VERSION_MAJOR > 53
43
- avcodec_free_frame (&_frame);
44
- #else
45
- av_free (_frame);
46
- #endif
47
- #endif
48
- _frame = NULL ;
49
- }
37
+ freeAVFrame ();
50
38
}
51
39
52
40
int Frame::getEncodedSize () const
@@ -100,6 +88,23 @@ void Frame::allocateAVFrame()
100
88
}
101
89
}
102
90
91
+ void Frame::freeAVFrame ()
92
+ {
93
+ if (_frame != NULL )
94
+ {
95
+ #if LIBAVCODEC_VERSION_MAJOR > 54
96
+ av_frame_free (&_frame);
97
+ #else
98
+ #if LIBAVCODEC_VERSION_MAJOR > 53
99
+ avcodec_free_frame (&_frame);
100
+ #else
101
+ av_free (_frame);
102
+ #endif
103
+ #endif
104
+ _frame = NULL ;
105
+ }
106
+ }
107
+
103
108
bool Frame::isAudioFrame () const
104
109
{
105
110
if (_frame->sample_rate && _frame->channels && _frame->channel_layout && _frame->format != -1 )
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ class AvExport Frame
101
101
102
102
private:
103
103
void allocateAVFrame ();
104
+ void freeAVFrame ();
104
105
105
106
protected:
106
107
AVFrame* _frame;
You can’t perform that action at this time.
0 commit comments