diff -Naur src.orig/libavcodec/mpeg12enc.c src/libavcodec/mpeg12enc.c
|
old
|
new
|
|
| 1161 | 1161 | .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, |
| 1162 | 1162 | AV_PIX_FMT_NONE }, |
| 1163 | 1163 | .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, |
| | 1164 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1164 | 1165 | .priv_class = &mpeg1_class, |
| 1165 | 1166 | }; |
| 1166 | 1167 | |
| … |
… |
|
| 1178 | 1179 | AV_PIX_FMT_YUV422P, |
| 1179 | 1180 | AV_PIX_FMT_NONE }, |
| 1180 | 1181 | .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS, |
| | 1182 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1181 | 1183 | .priv_class = &mpeg2_class, |
| 1182 | 1184 | }; |
diff -Naur src.orig/libavcodec/utils.c src/libavcodec/utils.c
|
old
|
new
|
|
| 540 | 540 | int ret = 0; |
| 541 | 541 | AVDictionary *tmp = NULL; |
| 542 | 542 | const AVPixFmtDescriptor *pixdesc; |
| | 543 | int needFrameThreadEncoderFreeOnError = 0; |
| | 544 | int needThreadFreeOnError = 0; |
| 543 | 545 | |
| 544 | 546 | if (avcodec_is_open(avctx)) |
| 545 | 547 | return 0; |
| … |
… |
|
| 724 | 726 | ff_lock_avcodec(avctx, codec); |
| 725 | 727 | if (ret < 0) |
| 726 | 728 | goto free_and_end; |
| | 729 | needFrameThreadEncoderFreeOnError = 1; |
| 727 | 730 | } |
| 728 | 731 | |
| 729 | 732 | if (HAVE_THREADS |
| … |
… |
|
| 732 | 735 | if (ret < 0) { |
| 733 | 736 | goto free_and_end; |
| 734 | 737 | } |
| | 738 | needThreadFreeOnError = 1; |
| 735 | 739 | } |
| 736 | 740 | if (!HAVE_THREADS && !(codec->capabilities & AV_CODEC_CAP_AUTO_THREADS)) |
| 737 | 741 | avctx->thread_count = 1; |
| … |
… |
|
| 1024 | 1028 | av_dict_free(&tmp); |
| 1025 | 1029 | av_freep(&avctx->priv_data); |
| 1026 | 1030 | if (avctx->internal) { |
| | 1031 | if (needFrameThreadEncoderFreeOnError |
| | 1032 | && avctx->internal->frame_thread_encoder) |
| | 1033 | { |
| | 1034 | ff_frame_thread_encoder_free(avctx); |
| | 1035 | } |
| | 1036 | if (needThreadFreeOnError |
| | 1037 | && avctx->internal->thread_ctx) |
| | 1038 | { |
| | 1039 | ff_thread_free(avctx); |
| | 1040 | } |
| 1027 | 1041 | av_frame_free(&avctx->internal->to_free); |
| 1028 | 1042 | av_frame_free(&avctx->internal->compat_decode_frame); |
| 1029 | 1043 | av_frame_free(&avctx->internal->buffer_frame); |