mirror of
https://github.com/jellyfin/jellyfin-ffmpeg.git
synced 2026-09-02 21:03:08 +03:00
Backport a fix to not stall sub2video on stream EOF
Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
+40
@@ -0,0 +1,40 @@
|
||||
Index: FFmpeg/fftools/ffmpeg_filter.c
|
||||
===================================================================
|
||||
--- FFmpeg.orig/fftools/ffmpeg_filter.c
|
||||
+++ FFmpeg/fftools/ffmpeg_filter.c
|
||||
@@ -2209,7 +2209,7 @@ static int configure_filtergraph(FilterG
|
||||
AVFrame *tmp;
|
||||
while (av_fifo_read(ifp->frame_queue, &tmp, 1) >= 0) {
|
||||
if (ifp->type_src == AVMEDIA_TYPE_SUBTITLE) {
|
||||
- sub2video_frame(&ifp->ifilter, tmp, !fgt->graph);
|
||||
+ ret = sub2video_frame(&ifp->ifilter, tmp, !fgt->graph);
|
||||
} else {
|
||||
if (ifp->type_src == AVMEDIA_TYPE_VIDEO) {
|
||||
if (ifp->displaymatrix_applied)
|
||||
@@ -2983,16 +2983,17 @@ static int sub2video_frame(InputFilter *
|
||||
int ret;
|
||||
|
||||
if (buffer) {
|
||||
- AVFrame *tmp;
|
||||
-
|
||||
- if (!frame)
|
||||
- return 0;
|
||||
+ // queue a NULL entry for EOF, so it is not lost when
|
||||
+ // the queue is replayed after configuring the graph
|
||||
+ AVFrame *tmp = NULL;
|
||||
+
|
||||
+ if (frame) {
|
||||
+ tmp = av_frame_alloc();
|
||||
+ if (!tmp)
|
||||
+ return AVERROR(ENOMEM);
|
||||
|
||||
- tmp = av_frame_alloc();
|
||||
- if (!tmp)
|
||||
- return AVERROR(ENOMEM);
|
||||
-
|
||||
- av_frame_move_ref(tmp, frame);
|
||||
+ av_frame_move_ref(tmp, frame);
|
||||
+ }
|
||||
|
||||
ret = av_fifo_write(ifp->frame_queue, &tmp, 1);
|
||||
if (ret < 0) {
|
||||
Vendored
+1
@@ -95,3 +95,4 @@
|
||||
0095-add-scale-d3d11-p010-shader-fallback.patch
|
||||
0096-fix-full-range-input-for-mjpeg-vaapi-encoder.patch
|
||||
0097-add-misc-enhancements-to-mfenc-hw-encoder.patch
|
||||
0098-backport-a-fix-to-not-stall-sub2video-on-stream-eof.patch
|
||||
|
||||
Reference in New Issue
Block a user