55 lines
2.1 KiB
Plaintext
55 lines
2.1 KiB
Plaintext
$OpenBSD: patch-libmpcodecs_vd_ffmpeg_c,v 1.1 2013/01/14 02:20:41 brad Exp $
|
|
--- libmpcodecs/vd_ffmpeg.c.orig Sun Apr 29 01:38:02 2012
|
|
+++ libmpcodecs/vd_ffmpeg.c Sun Apr 29 01:50:45 2012
|
|
@@ -103,6 +103,8 @@ static char *lavc_param_skip_frame_str = NULL;
|
|
static int lavc_param_threads=1;
|
|
static int lavc_param_bitexact=0;
|
|
static char *lavc_avopt = NULL;
|
|
+static enum AVDiscard skip_idct;
|
|
+static enum AVDiscard skip_frame;
|
|
|
|
static const mp_image_t mpi_no_picture =
|
|
{
|
|
@@ -352,6 +354,9 @@ static int init(sh_video_t *sh){
|
|
}
|
|
}
|
|
|
|
+ skip_idct = avctx->skip_idct;
|
|
+ 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'):
|
|
@@ -603,13 +608,13 @@ static int get_buffer(AVCodecContext *avctx, AVFrame *
|
|
type = MP_IMGTYPE_STATIC;
|
|
flags |= MP_IMGFLAG_PRESERVE;
|
|
}
|
|
- flags|=(!avctx->hurry_up && ctx->do_slices) ?
|
|
+ flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
|
|
MP_IMGFLAG_DRAW_CALLBACK:0;
|
|
mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type == MP_IMGTYPE_STATIC ? "using STATIC\n" : "using TEMP\n");
|
|
} else {
|
|
if(!pic->reference){
|
|
ctx->b_count++;
|
|
- flags|=(!avctx->hurry_up && ctx->do_slices) ?
|
|
+ flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
|
|
MP_IMGFLAG_DRAW_CALLBACK:0;
|
|
}else{
|
|
ctx->ip_count++;
|
|
@@ -826,7 +831,14 @@ static mp_image_t *decode(sh_video_t *sh, void *data,
|
|
}
|
|
}
|
|
|
|
- avctx->hurry_up=(flags&3)?((flags&2)?2:1):0;
|
|
+ avctx->skip_idct = skip_idct;
|
|
+ avctx->skip_frame = skip_frame;
|
|
+
|
|
+ if (flags&3) {
|
|
+ avctx->skip_frame = AVDISCARD_NONREF;
|
|
+ if (flags&2)
|
|
+ avctx->skip_idct = AVDISCARD_ALL;
|
|
+ }
|
|
|
|
mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "vd_ffmpeg data: %04x, %04x, %04x, %04x\n",
|
|
((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]);
|