mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
vd_ffmpeg: fix "-lavdopts skipframe" support
Support for -lavdopts skipframe had been broken since commit bc767c2a9
as framedrop logic now set the same field and thus overwrote the value
set from the option. Change that code to set it to the original value
instead of 0 when not dropping frames.
This commit is contained in:
parent
2174cbfa2f
commit
1a7ef3b39c
@ -73,6 +73,7 @@ typedef struct {
|
||||
int b_count;
|
||||
AVRational last_sample_aspect_ratio;
|
||||
int lowres;
|
||||
enum AVDiscard skip_frame;
|
||||
} vd_ffmpeg_ctx;
|
||||
|
||||
#include "m_option.h"
|
||||
@ -284,6 +285,9 @@ static int init(sh_video_t *sh){
|
||||
}
|
||||
}
|
||||
|
||||
// Do this after the above avopt handling in case it changes values
|
||||
ctx->skip_frame = avctx->skip_frame;
|
||||
|
||||
mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "libavcodec.size: %d x %d\n", avctx->width, avctx->height);
|
||||
switch (sh->format) {
|
||||
case mmioFOURCC('S','V','Q','3'):
|
||||
@ -756,7 +760,7 @@ static struct mp_image *decode(struct sh_video *sh, void *data, int len,
|
||||
else if (flags & 1)
|
||||
avctx->skip_frame = AVDISCARD_NONREF;
|
||||
else
|
||||
avctx->skip_frame = 0;
|
||||
avctx->skip_frame = ctx->skip_frame;
|
||||
|
||||
mp_msg(MSGT_DECVIDEO, MSGL_DBG3, "vd_ffmpeg data: %04x, %04x, %04x, %04x\n",
|
||||
((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]);
|
||||
|
Loading…
Reference in New Issue
Block a user