[FFmpeg-devel] [PATCH] fftools/ffmpeg: Simplify flushing bsf

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Fri Nov 15 17:56:37 EET 2019


Since flushing can now also be signalled by sending an empty packet
(a packet without (side-)data), it is unnecessary to explicitly send
NULL as packet to flush the bitstream filters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 fftools/ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 27f68933f8..ccadabe83f 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -853,7 +853,7 @@ static void output_packet(OutputFile *of, AVPacket *pkt,
     if (ost->nb_bitstream_filters) {
         int idx;
 
-        ret = av_bsf_send_packet(ost->bsf_ctx[0], eof ? NULL : pkt);
+        ret = av_bsf_send_packet(ost->bsf_ctx[0], pkt);
         if (ret < 0)
             goto finish;
 
@@ -873,7 +873,7 @@ static void output_packet(OutputFile *of, AVPacket *pkt,
 
             /* send it to the next filter down the chain or to the muxer */
             if (idx < ost->nb_bitstream_filters) {
-                ret = av_bsf_send_packet(ost->bsf_ctx[idx], eof ? NULL : pkt);
+                ret = av_bsf_send_packet(ost->bsf_ctx[idx], pkt);
                 if (ret < 0)
                     goto finish;
                 idx++;
-- 
2.20.1



More information about the ffmpeg-devel mailing list