Credit MEHW - BT 656 fixes compile using latest Vulkan header files v1.3.280.0
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-6.1.patchC
1 --- a/libavcodec/encode.c
2 +++ b/libavcodec/encode.c
3 @@ -331,7 +331,7 @@
4      }
5  
6      if (!frame->buf[0]) {
7 -        if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY ||
8 +        if (avci->draining && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY ||
9                avci->frame_thread_encoder))
10              return AVERROR_EOF;
11  
12 @@ -350,8 +350,10 @@
13          ret = ff_encode_encode_cb(avctx, avpkt, frame, &got_packet);
14      }
15  
16 -    if (avci->draining && !got_packet)
17 +    if (avci->draining && !got_packet) {
18 +       fflush(stderr);
19          avci->draining_done = 1;
20 +    }
21  
22      return ret;
23  }
24 @@ -526,10 +528,16 @@
25      if (avci->draining)
26          return AVERROR_EOF;
27  
28 -    if (avci->buffer_frame->buf[0])
29 +    if (avci->buffer_frame->buf[0]) {
30 +        if (!frame) {
31 +           fflush(stderr);
32 +            av_frame_unref(avci->buffer_frame);
33 +       }
34          return AVERROR(EAGAIN);
35 +    }
36  
37      if (!frame) {
38 +       fflush(stderr);
39          avci->draining = 1;
40      } else {
41          ret = encode_send_frame_internal(avctx, frame);