@@ -422,6 +422,7 @@ int cyanrip_create_dec_ctx(cyanrip_ctx *ctx, cyanrip_dec_ctx **s,
422
422
if ((ctx -> settings .decode_hdcd ) ||
423
423
(ctx -> settings .deemphasis && t -> preemphasis ) ||
424
424
(ctx -> settings .force_deemphasis )) {
425
+
425
426
ret = init_filtering (ctx , & dec_ctx -> filt ,
426
427
ctx -> settings .decode_hdcd ,
427
428
(ctx -> settings .deemphasis && t -> preemphasis ) || ctx -> settings .force_deemphasis ,
@@ -491,6 +492,7 @@ static int filter_frame(cyanrip_ctx *ctx, cyanrip_enc_ctx **enc_ctx,
491
492
if (!dec_ctx -> filt .buffersrc_ctx )
492
493
return push_frame_to_encs (ctx , enc_ctx , num_enc , frame );
493
494
495
+
494
496
ret = av_buffersrc_add_frame_flags (dec_ctx -> filt .buffersrc_ctx , frame ,
495
497
AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT |
496
498
AV_BUFFERSRC_FLAG_KEEP_REF );
@@ -499,6 +501,14 @@ static int filter_frame(cyanrip_ctx *ctx, cyanrip_enc_ctx **enc_ctx,
499
501
goto fail ;
500
502
}
501
503
504
+ ret = avfilter_graph_request_oldest (dec_ctx -> filt .graph );
505
+ if (ret == AVERROR_EOF ) {
506
+ return push_frame_to_encs (ctx , enc_ctx , num_enc , NULL );
507
+ } else if (ret < 0 ) {
508
+ cyanrip_log (ctx , 0 , "Error filtering frame: %s!\n" , av_err2str (ret ));
509
+ goto fail ;
510
+ }
511
+
502
512
while (1 ) {
503
513
dec_frame = av_frame_alloc ();
504
514
if (!dec_frame ) {
0 commit comments