aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <cboesch@gopro.com>2017-01-31 17:35:41 +0100
committerClément Bœsch <cboesch@gopro.com>2017-01-31 17:35:41 +0100
commit126e96533f4526fc84fa68f3023d991622e287d3 (patch)
treeb3fd9951cfa15751e4928030cde363863d79ee96
parent591cf8aa0ee9e09aac29861f4229616df7604172 (diff)
parent9833a406d3d743d238e4cbee08ffcaa12e067dd2 (diff)
downloadffmpeg-126e96533f4526fc84fa68f3023d991622e287d3.tar.gz
Merge commit '9833a406d3d743d238e4cbee08ffcaa12e067dd2'
* commit '9833a406d3d743d238e4cbee08ffcaa12e067dd2': examples: Properly free AVCodecContext Merged-by: Clément Bœsch <cboesch@gopro.com>
-rw-r--r--doc/examples/decoding_encoding.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c
index 43a64c2d59..1c5a78a44d 100644
--- a/doc/examples/decoding_encoding.c
+++ b/doc/examples/decoding_encoding.c
@@ -232,8 +232,7 @@ static void audio_encode_example(const char *filename)
av_freep(&samples);
av_frame_free(&frame);
- avcodec_close(c);
- av_free(c);
+ avcodec_free_context(&c);
}
/*
@@ -336,8 +335,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
fclose(outfile);
fclose(f);
- avcodec_close(c);
- av_free(c);
+ avcodec_free_context(&c);
av_frame_free(&decoded_frame);
}
@@ -479,8 +477,7 @@ static void video_encode_example(const char *filename, int codec_id)
fwrite(endcode, 1, sizeof(endcode), f);
fclose(f);
- avcodec_close(c);
- av_free(c);
+ avcodec_free_context(&c);
av_freep(&frame->data[0]);
av_frame_free(&frame);
printf("\n");
@@ -622,8 +619,7 @@ static void video_decode_example(const char *outfilename, const char *filename)
fclose(f);
- avcodec_close(c);
- av_free(c);
+ avcodec_free_context(&c);
av_frame_free(&frame);
printf("\n");
}