Unified · Split
| @@ -213,8 +213,7 @@ static void audio_encode_example(const char *filename) · 212 unmodified lines | |||
| 213 | 213 | ||
| 214 | av_freep(&samples); | 214 | av_freep(&samples); |
| 215 | av_frame_free(&frame); | 215 | av_frame_free(&frame); |
| 216 | avcodec_close(c); | 216 | avcodec_free_context(&c); |
| 217 | av_free(c); | ||
| 218 | } | 217 | } |
| 219 | 218 | ||
| 220 | /* | 219 | /* |
| @@ -305,8 +304,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 84 unmodified lines | |||
| 305 | fclose(outfile); | 304 | fclose(outfile); |
| 306 | fclose(f); | 305 | fclose(f); |
| 307 | 306 | ||
| 308 | avcodec_close(c); | 307 | avcodec_free_context(&c); |
| 309 | av_free(c); | ||
| 310 | av_frame_free(&decoded_frame); | 308 | av_frame_free(&decoded_frame); |
| 311 | } | 309 | } |
| 312 | 310 | ||
| @@ -428,8 +426,7 @@ static void video_encode_example(const char *filename) · 115 unmodified lines | |||
| 428 | fwrite(endcode, 1, sizeof(endcode), f); | 426 | fwrite(endcode, 1, sizeof(endcode), f); |
| 429 | fclose(f); | 427 | fclose(f); |
| 430 | 428 | ||
| 431 | avcodec_close(c); | 429 | avcodec_free_context(&c); |
| 432 | av_free(c); | ||
| 433 | av_freep(&picture->data[0]); | 430 | av_freep(&picture->data[0]); |
| 434 | av_frame_free(&picture); | 431 | av_frame_free(&picture); |
| 435 | printf("\n"); | 432 | printf("\n"); |
| @@ -565,8 +562,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 129 unmodified lines | |||
| 565 | 562 | ||
| 566 | fclose(f); | 563 | fclose(f); |
| 567 | 564 | ||
| 568 | avcodec_close(c); | 565 | avcodec_free_context(&c); |
| 569 | av_free(c); | ||
| 570 | av_frame_free(&picture); | 566 | av_frame_free(&picture); |
| 571 | printf("\n"); | 567 | printf("\n"); |
| 572 | } | 568 | } |