summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_ffmpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r--libmpcodecs/vd_ffmpeg.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 941aae7175..a358dea014 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -239,6 +239,8 @@ static int init(sh_video_t *sh)
} else {
avctx->pix_fmt = rawfmt;
}
+ if (sh->gsh->lavf_codec_tag)
+ avctx->codec_tag = sh->gsh->lavf_codec_tag;
avctx->stream_codec_tag = sh->video.fccHandler;
avctx->idct_algo = lavc_param->idct_algo;
avctx->error_concealment = lavc_param->error_concealment;
@@ -444,8 +446,8 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt)
sh->colorspace = avcol_spc_to_mp_csp(avctx->colorspace);
sh->color_range = avcol_range_to_mp_csp_levels(avctx->color_range);
- if (!mpcodecs_config_vo2(sh, sh->disp_w, sh->disp_h, supported_fmts,
- ctx->best_csp))
+ if (!mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, supported_fmts,
+ ctx->best_csp))
return -1;
ctx->vo_initialized = 1;
}
@@ -585,6 +587,10 @@ static void release_buffer(struct AVCodecContext *avctx, AVFrame *pic)
if (mpi) {
// release mpi (in case MPI_IMGTYPE_NUMBERED is used, e.g. for VDPAU)
mpi->usage_count--;
+ if (mpi->usage_count < 0) {
+ mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad mp_image usage count, please report!\n");
+ mpi->usage_count = 0;
+ }
}
if (pic->type != FF_BUFFER_TYPE_USER) {
@@ -802,7 +808,7 @@ static enum PixelFormat get_format(struct AVCodecContext *avctx,
return fmt[i];
}
-static int control(sh_video_t *sh, int cmd, void *arg, ...)
+static int control(sh_video_t *sh, int cmd, void *arg)
{
vd_ffmpeg_ctx *ctx = sh->context;
AVCodecContext *avctx = ctx->avctx;
@@ -847,5 +853,5 @@ const struct vd_functions mpcodecs_vd_ffmpeg = {
.init = init,
.uninit = uninit,
.control = control,
- .decode2 = decode
+ .decode = decode,
};