rename file and add Andrew 0002 HAVE_DV patch
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-4.4.patchB
1 diff --git a/libavcodec/encode.c b/libavcodec/encode_fprint.c
2 index 89df523..cca0cc1 100644
3 --- a/libavcodec/encode.c
4 +++ b/libavcodec/encode_fprint.c
5 @@ -191,7 +191,7 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
6      }
7  
8      if (!frame->buf[0]) {
9 -        if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY ||
10 +        if (avci->draining && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY ||
11                (avci->frame_thread_encoder && avctx->active_thread_type & FF_THREAD_FRAME)))
12              return AVERROR_EOF;
13  
14 @@ -246,8 +246,10 @@ static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
15          }
16      }
17  
18 -    if (avci->draining && !got_packet)
19 +    if (avci->draining && !got_packet) {
20 +       fflush(stderr);
21          avci->draining_done = 1;
22 +    }
23  
24  end:
25      if (ret < 0 || !got_packet)
26 @@ -372,10 +374,16 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame
27      if (avci->draining)
28          return AVERROR_EOF;
29  
30 -    if (avci->buffer_frame->data[0])
31 +    if (avci->buffer_frame->data[0]) {
32 +        if (!frame) {
33 +           fflush(stderr);
34 +            av_frame_unref(avci->buffer_frame);
35 +       }
36          return AVERROR(EAGAIN);
37 +    }
38  
39      if (!frame) {
40 +       fflush(stderr);
41          avci->draining = 1;
42      } else {
43          ret = encode_send_frame_internal(avctx, frame);