summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-07-09 13:50:16 +0300
committerUoti Urpala <uau@mplayer2.org>2011-07-09 13:50:16 +0300
commit1a7ef3b39c38837b45f87ce8b673da5641289573 (patch)
treeb605fc2816ffc7d7fc68255751e319f832aba0f1 /libmpcodecs
parent2174cbfa2fd153e7a77ba5ef7167d2bf99057330 (diff)
downloadmpv-1a7ef3b39c38837b45f87ce8b673da5641289573.tar.bz2
mpv-1a7ef3b39c38837b45f87ce8b673da5641289573.tar.xz
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.
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 4f9f5a3e24..630d0c5e02 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -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]);