mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
vd_ffmpeg: disable slice use that fails with size changes
When not using direct rendering, vd_ffmpeg created an mp_image struct before calling libavcodec decoder, so that possible slice support could be checked from the mpi_image and output would be ready for slice-drawing calls. However, this behavior is unsound with decoders that can change output size, as the parameters can change after the mp_image was created. Disable the code creating the mp_image at that point, which also disables use of slices in this case. Slices are disabled with threading anyway, so I think trying to add workarounds to support them is not a high priority. I think this code has always been buggy, but before common thread use it was rarely executed because the direct-rendering case was used instead.
This commit is contained in:
parent
dd1b848d92
commit
505f94cef9
@ -684,15 +684,6 @@ static struct mp_image *decode(struct sh_video *sh, struct demux_packet *packet,
|
||||
|
||||
if (!dr1)
|
||||
avctx->draw_horiz_band = NULL;
|
||||
if (ctx->vo_initialized && !(flags & 3) && !dr1) {
|
||||
mpi = mpcodecs_get_image(sh, MP_IMGTYPE_EXPORT, MP_IMGFLAG_PRESERVE |
|
||||
(ctx->do_slices ? MP_IMGFLAG_DRAW_CALLBACK : 0),
|
||||
sh->disp_w, sh->disp_h);
|
||||
if (mpi && mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) {
|
||||
// vd core likes slices!
|
||||
avctx->draw_horiz_band = draw_slice;
|
||||
}
|
||||
}
|
||||
|
||||
if (flags & 2)
|
||||
avctx->skip_frame = AVDISCARD_ALL;
|
||||
|
Loading…
Reference in New Issue
Block a user