summaryrefslogtreecommitdiff
path: root/rotord/src/libavwrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/libavwrapper.cpp')
-rw-r--r--rotord/src/libavwrapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/rotord/src/libavwrapper.cpp b/rotord/src/libavwrapper.cpp
index 0ba76ea..15a84d1 100644
--- a/rotord/src/libavwrapper.cpp
+++ b/rotord/src/libavwrapper.cpp
@@ -1241,7 +1241,7 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream *
{
AVCodecContext *c;
AVPacket pkt = { 0 }; // data and size must be 0;
- AVFrame *frame = avcodec_alloc_frame();
+ AVFrame *frame = avcodec_alloc_frame();
int got_packet, ret;
av_init_packet(&pkt);
@@ -1281,6 +1281,8 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream *
pkt.stream_index = st->index;
+ avcodec_free_frame(&frame);
+
// Write the compressed frame to the media file. //
ret = av_interleaved_write_frame(oc, &pkt);
if (ret != 0) {
@@ -1288,7 +1290,7 @@ void libav::exporter::open_video(AVFormatContext *oc, AVCodec *codec, AVStream *
// av_err2str(ret));
exit(1);
}
- avcodec_free_frame(&frame);
+
}
void libav::exporter::write_audio_frame(AVFormatContext *oc, AVStream *st,AVPacket *pkt)