[FFmpeg-devel] [PATCH 1/2] avcodec/bsf: Check side data when setting BSF EOF flag.

sebechlebskyjan at gmail.com sebechlebskyjan at gmail.com
Fri Jul 22 20:52:34 EEST 2016

From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>

Set BSF EOF flag only if pkt == NULL or both data and
side data are not present in packet.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
 I believe that side data should be checked too, and 
 EOF flag set only when both data and side data are
 not present.

 I was testing new list BSF API I was working on,
 and with simple pass-though (empty list) BSF filter,
 some tests were failing because packets containing only
 side data were taken as EOF signal for bitsteam filter. 

 Also, I've added comment about this behaviour in next

 libavcodec/bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 88b7f29..94f0122 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -172,7 +172,7 @@ int av_bsf_init(AVBSFContext *ctx)
 int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
-    if (!pkt || !pkt->data) {
+    if (!pkt || (!pkt->data && !pkt->side_data_elems)) {
         ctx->internal->eof = 1;
         return 0;

More information about the ffmpeg-devel mailing list