-
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from nyanmisaka/next
[6.0] Update queued key fixes from upstream
- Loading branch information
Showing
7 changed files
with
142 additions
and
101 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
debian/patches/0048-fix-nvenc-potential-null-pointer-dereference.patch
This file was deleted.
Oops, something went wrong.
File renamed without changes.
131 changes: 131 additions & 0 deletions
131
debian/patches/0049-add-queued-key-fixes-from-upstream.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
Index: jellyfin-ffmpeg/libavcodec/nvenc.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/libavcodec/nvenc.c | ||
+++ jellyfin-ffmpeg/libavcodec/nvenc.c | ||
@@ -178,6 +178,8 @@ static void reorder_queue_flush(AVFifo * | ||
{ | ||
FrameData fd; | ||
|
||
+ av_assert0(queue); | ||
+ | ||
while (av_fifo_read(queue, &fd, 1) >= 0) | ||
av_buffer_unref(&fd.frame_opaque_ref); | ||
} | ||
@@ -1853,8 +1855,11 @@ av_cold int ff_nvenc_encode_close(AVCode | ||
p_nvenc->nvEncEncodePicture(ctx->nvencoder, ¶ms); | ||
} | ||
|
||
- reorder_queue_flush(ctx->reorder_queue); | ||
- av_fifo_freep2(&ctx->reorder_queue); | ||
+ if (ctx->reorder_queue) { | ||
+ reorder_queue_flush(ctx->reorder_queue); | ||
+ av_fifo_freep2(&ctx->reorder_queue); | ||
+ } | ||
+ | ||
av_fifo_freep2(&ctx->output_surface_ready_queue); | ||
av_fifo_freep2(&ctx->output_surface_queue); | ||
av_fifo_freep2(&ctx->unused_surface_queue); | ||
Index: jellyfin-ffmpeg/libavfilter/graphparser.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/libavfilter/graphparser.c | ||
+++ jellyfin-ffmpeg/libavfilter/graphparser.c | ||
@@ -532,8 +532,7 @@ int avfilter_graph_segment_create_filter | ||
for (size_t j = 0; j < ch->nb_filters; j++) { | ||
AVFilterParams *p = ch->filters[j]; | ||
const AVFilter *f = avfilter_get_by_name(p->filter_name); | ||
- char inst_name[30], *name = p->instance_name ? p->instance_name : | ||
- inst_name; | ||
+ char name[64]; | ||
|
||
// skip already processed filters | ||
if (p->filter || !p->filter_name) | ||
@@ -546,7 +545,9 @@ int avfilter_graph_segment_create_filter | ||
} | ||
|
||
if (!p->instance_name) | ||
- snprintf(inst_name, sizeof(inst_name), "Parsed_%s_%zu", f->name, idx); | ||
+ snprintf(name, sizeof(name), "Parsed_%s_%zu", f->name, idx); | ||
+ else | ||
+ snprintf(name, sizeof(name), "%s@%s", f->name, p->instance_name); | ||
|
||
p->filter = avfilter_graph_alloc_filter(seg->graph, f, name); | ||
if (!p->filter) | ||
Index: jellyfin-ffmpeg/libavcodec/nvenc.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/libavcodec/nvenc.c | ||
+++ jellyfin-ffmpeg/libavcodec/nvenc.c | ||
@@ -461,7 +461,7 @@ static int nvenc_check_cap(AVCodecContex | ||
static int nvenc_check_capabilities(AVCodecContext *avctx) | ||
{ | ||
NvencContext *ctx = avctx->priv_data; | ||
- int ret; | ||
+ int tmp, ret; | ||
|
||
ret = nvenc_check_codec_support(avctx); | ||
if (ret < 0) { | ||
@@ -542,16 +542,18 @@ static int nvenc_check_capabilities(AVCo | ||
} | ||
|
||
#ifdef NVENC_HAVE_BFRAME_REF_MODE | ||
+ tmp = (ctx->b_ref_mode >= 0) ? ctx->b_ref_mode : NV_ENC_BFRAME_REF_MODE_DISABLED; | ||
ret = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_BFRAME_REF_MODE); | ||
- if (ctx->b_ref_mode == NV_ENC_BFRAME_REF_MODE_EACH && ret != 1 && ret != 3) { | ||
+ if (tmp == NV_ENC_BFRAME_REF_MODE_EACH && ret != 1 && ret != 3) { | ||
av_log(avctx, AV_LOG_WARNING, "Each B frame as reference is not supported\n"); | ||
return AVERROR(ENOSYS); | ||
- } else if (ctx->b_ref_mode != NV_ENC_BFRAME_REF_MODE_DISABLED && ret == 0) { | ||
+ } else if (tmp != NV_ENC_BFRAME_REF_MODE_DISABLED && ret == 0) { | ||
av_log(avctx, AV_LOG_WARNING, "B frames as references are not supported\n"); | ||
return AVERROR(ENOSYS); | ||
} | ||
#else | ||
- if (ctx->b_ref_mode != 0) { | ||
+ tmp = (ctx->b_ref_mode >= 0) ? ctx->b_ref_mode : 0; | ||
+ if (tmp > 0) { | ||
av_log(avctx, AV_LOG_WARNING, "B frames as references need SDK 8.1 at build time\n"); | ||
return AVERROR(ENOSYS); | ||
} | ||
Index: jellyfin-ffmpeg/libavcodec/decode.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/libavcodec/decode.c | ||
+++ jellyfin-ffmpeg/libavcodec/decode.c | ||
@@ -140,7 +140,7 @@ static int extract_packet_props(AVCodecI | ||
if (pkt) { | ||
ret = av_packet_copy_props(avci->last_pkt_props, pkt); | ||
if (!ret) | ||
- avci->last_pkt_props->opaque = (void *)(intptr_t)pkt->size; // Needed for ff_decode_frame_props(). | ||
+ avci->last_pkt_props->stream_index = pkt->size; // Needed for ff_decode_frame_props(). | ||
} | ||
return ret; | ||
} | ||
@@ -461,7 +461,7 @@ FF_ENABLE_DEPRECATION_WARNINGS | ||
pkt->dts = AV_NOPTS_VALUE; | ||
if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { | ||
// See extract_packet_props() comment. | ||
- avci->last_pkt_props->opaque = (void *)((intptr_t)avci->last_pkt_props->opaque - consumed); | ||
+ avci->last_pkt_props->stream_index = avci->last_pkt_props->stream_index - consumed; | ||
avci->last_pkt_props->pts = AV_NOPTS_VALUE; | ||
avci->last_pkt_props->dts = AV_NOPTS_VALUE; | ||
} | ||
@@ -1355,7 +1355,7 @@ int ff_decode_frame_props(AVCodecContext | ||
int ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); | ||
if (ret < 0) | ||
return ret; | ||
- frame->pkt_size = (int)(intptr_t)pkt->opaque; | ||
+ frame->pkt_size = pkt->stream_index; | ||
} | ||
#if FF_API_REORDERED_OPAQUE | ||
FF_DISABLE_DEPRECATION_WARNINGS | ||
Index: jellyfin-ffmpeg/fftools/ffmpeg_mux_init.c | ||
=================================================================== | ||
--- jellyfin-ffmpeg.orig/fftools/ffmpeg_mux_init.c | ||
+++ jellyfin-ffmpeg/fftools/ffmpeg_mux_init.c | ||
@@ -2063,7 +2063,7 @@ static void parse_forced_key_frames(Keyf | ||
if (next) | ||
*next++ = 0; | ||
|
||
- if (!memcmp(p, "chapters", 8)) { | ||
+ if (strstr(p, "chapters") == p) { | ||
AVChapter * const *ch = mux->fc->chapters; | ||
unsigned int nb_ch = mux->fc->nb_chapters; | ||
int j; |
25 changes: 0 additions & 25 deletions
25
debian/patches/0049-fix-filter_at_id_syntax_from_upstream.patch
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters