On Wednesday, August 11, 2021, Andrea paz via Cin <
[email protected]> wrote:

> > Andrea,  in a followup, to your email below.  Does this mean that the
> patch, ffmpeg_flush_tmp.diff, fixed ffmpeg 4.4 so that it works the same as
> 4.3?  I > was confused if you had applied this patch or not or had just
> changed render formats.
>
> It seems to me that this patch is not in randrik14, so I didn't put it
> in. Where can I find it? What other randrik14 patches should I put for
> ffmpeg-4.4? Sorry for the confusion!


hopefully attached (I send it separately)


-- 
> Cin mailing list
> [email protected]
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
diff --git a/cinelerra-5.1/cinelerra/ffmpeg.C b/cinelerra-5.1/cinelerra/ffmpeg.C
index b51fe5f7..d1eb4da2 100644
--- a/cinelerra-5.1/cinelerra/ffmpeg.C
+++ b/cinelerra-5.1/cinelerra/ffmpeg.C
@@ -14,7 +14,7 @@
 #ifndef INT64_MAX
 #define INT64_MAX 9223372036854775807LL
 #endif
-#define MAX_RETRY 1000
+#define MAX_RETRY 4000
 // max pts/curr_pos drift allowed before correction (in seconds)
 #define AUDIO_PTS_TOLERANCE 0.04
 
@@ -608,7 +608,8 @@ int FFStream::encode_frame(AVFrame *frame)
                if( ret < 0 && ret != AVERROR(EAGAIN) ) break;
                FFPacket opkt;
                ret = avcodec_receive_packet(avctx, opkt);
-               if( !frame && ret == AVERROR_EOF ) return pkts;
+               if( !frame && (ret == AVERROR_EOF) || (ret == AVERROR(EAGAIN)))
+               return pkts;
                if( ret < 0 ) break;
                ret = write_packet(opkt);
                if( ret < 0 ) break;
@@ -627,7 +628,7 @@ int FFStream::flush()
 {
        if( writing < 0 )
                return -1;
-       int ret = encode_frame(0);
+       int ret = encode_frame(NULL);
        if( ret >= 0 && stats_fp ) {
                ret = write_stats_file();
                close_stats_file();
-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to