[MPlayer-cvslog] r37875 - trunk/libmpcodecs/vf_screenshot.c

rtogni subversion at mplayerhq.hu
Sun Jul 3 22:06:11 CEST 2016


Author: rtogni
Date: Sun Jul  3 22:06:11 2016
New Revision: 37875

Log:
Fix crash with screenshot filter.

avcodec_open2() now requires timebase to be always set, even for png images.
The patch sets it to 1/1, since pictures do not have a framerate.

Patch by Thomas Kirsten (Tho_Ki gmx de)

Modified:
   trunk/libmpcodecs/vf_screenshot.c

Modified: trunk/libmpcodecs/vf_screenshot.c
==============================================================================
--- trunk/libmpcodecs/vf_screenshot.c	Sun Jul  3 21:09:28 2016	(r37874)
+++ trunk/libmpcodecs/vf_screenshot.c	Sun Jul  3 22:06:11 2016	(r37875)
@@ -81,6 +81,8 @@ static int config(struct vf_instance *vf
         vf->priv->avctx->pix_fmt = AV_PIX_FMT_RGB24;
         vf->priv->avctx->width = d_width;
         vf->priv->avctx->height = d_height;
+        vf->priv->avctx->time_base.num = 1;
+        vf->priv->avctx->time_base.den = 1;
         vf->priv->avctx->compression_level = 0;
         if (avcodec_open2(vf->priv->avctx, avcodec_find_encoder(AV_CODEC_ID_PNG), NULL)) {
             mp_msg(MSGT_VFILTER, MSGL_FATAL, "Could not open libavcodec PNG encoder\n");


More information about the MPlayer-cvslog mailing list