From 40f04b0ce3f125b5310ed81f23d0f9919413cb85 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Mon, 6 Feb 2017 10:39:35 +0000 Subject: [PATCH] Fix screenshot crash (rfbz#4391) --- mplayer-fix-screenshot-crash.patch | 26 ++++++++++++++++++++++++++ mplayer.spec | 14 +++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 mplayer-fix-screenshot-crash.patch diff --git a/mplayer-fix-screenshot-crash.patch b/mplayer-fix-screenshot-crash.patch new file mode 100644 index 0000000..9f17461 --- /dev/null +++ b/mplayer-fix-screenshot-crash.patch @@ -0,0 +1,26 @@ +From bbaf524d691d6bfecfd65175259fd61abc6e5f69 Mon Sep 17 00:00:00 2001 +From: rtogni +Date: Sun, 3 Jul 2016 20:06:11 +0000 +Subject: [PATCH] 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) +--- + libmpcodecs/vf_screenshot.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c +index 4692d20..992ea6d 100644 +--- a/libmpcodecs/vf_screenshot.c ++++ b/libmpcodecs/vf_screenshot.c +@@ -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"); diff --git a/mplayer.spec b/mplayer.spec index 3713015..2d15014 100644 --- a/mplayer.spec +++ b/mplayer.spec @@ -7,9 +7,9 @@ Name: mplayer Version: 1.3.0 %if 0%{?svn} -Release: 36.%{?pre}%{?dist} +Release: 37.%{?pre}%{?dist} %else -Release: 5%{?dist} +Release: 6%{?dist} %endif Summary: Movie player playing most video formats and DVDs @@ -32,7 +32,11 @@ Patch0: %{name}-config.patch # use roff include statements instead of symlinks Patch1: %{name}-manlinks.patch # use system FFmpeg libraries -Patch3: %{name}-ffmpeg.patch +Patch3: %{name}-ffmpeg.patch +# Fix screenshot crash +# https://bugzilla.rpmfusion.org/show_bug.cgi?id=4391 +# Patch is from an upstream svn commit +Patch4: %{name}-fix-screenshot-crash.patch BuildRequires: SDL-devel BuildRequires: a52dec-devel @@ -226,6 +230,7 @@ rm -rf ffmpeg %patch0 -p1 -b .config %patch1 -p1 -b .manlinks %patch3 -p1 -b .ffmpeg +%patch4 -p1 -b .screenshot mkdir GUI cp -a `ls -1|grep -v GUI` GUI/ @@ -381,6 +386,9 @@ update-desktop-database &>/dev/null || : %{_datadir}/mplayer/*.fp %changelog +* Mon Feb 06 2017 Leigh Scott - 1.3.0-6 +- Fix screenshot crash (rfbz#4391) + * Thu Nov 17 2016 Adrian Reber - 1.3.0-5 - Rebuilt for libcdio-0.94