History

Merge commit '9833a406d3d743d238e4cbee08ffcaa12e067dd2'

* commit '9833a406d3d743d238e4cbee08ffcaa12e067dd2': examples: Properly free AVCodecContext

Clément Bœsch committed 9 years ago

Commit 126e9652 parents 591cf8a 9833a401 file · +4 −8Browse files

Showing the changes to doc/examples/decoding_encoding.c (1 of 1 file). Show all

Unified · Split

doc/examples/decoding_encoding.c+4−8
@@ -232,8 +232,7 @@ static void audio_encode_example(const char *filename) · 231 unmodified lines
232232
233233 av_freep(&samples);
234234 av_frame_free(&frame);
235− avcodec_close(c);
236− av_free(c);
235+ avcodec_free_context(&c);
237236 }
238237
239238 /*
@@ -336,8 +335,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 96 unmodified lines
336335 fclose(outfile);
337336 fclose(f);
338337
339− avcodec_close(c);
340− av_free(c);
338+ avcodec_free_context(&c);
341339 av_frame_free(&decoded_frame);
342340 }
343341
@@ -479,8 +477,7 @@ static void video_encode_example(const char *filename, int codec_id) · 135 unmodified lines
479477 fwrite(endcode, 1, sizeof(endcode), f);
480478 fclose(f);
481479
482− avcodec_close(c);
483− av_free(c);
480+ avcodec_free_context(&c);
484481 av_freep(&frame->data[0]);
485482 av_frame_free(&frame);
486483 printf("\n");
@@ -622,8 +619,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 135 unmodified lines
622619
623620 fclose(f);
624621
625− avcodec_close(c);
626− av_free(c);
622+ avcodec_free_context(&c);
627623 av_frame_free(&frame);
628624 printf("\n");
629625 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t