pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/multimedia/gst-plugins1-libav gst-plugins1-libav: fix ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6e4b6be9bc2b
branches:  trunk
changeset: 371706:6e4b6be9bc2b
user:      prlw1 <prlw1%pkgsrc.org@localhost>
date:      Fri Nov 17 23:21:06 2017 +0000

description:
gst-plugins1-libav: fix mp4 playback

>From Jana Saout in https://bugzilla.gnome.org/show_bug.cgi?id=789193

Not meant as "fix" but as temporary workaround for people bothered
by this issue:

This quick & dirty hack replaces the deprecated call to
avcodec_decode_video2 by calls to avcodec_send_packet and
avcodec_receive_frame.

Note that this is hack is really ugly, because the API really isn't
meant to be used this way (the assumption is that each call to
avcodec_send_packet will produce at most one new frame) and also
the error handling and probably other cases are not handled correctly.

However, MP4 videos seem to play fine for me.

diffstat:

 multimedia/gst-plugins1-libav/Makefile                              |   3 +-
 multimedia/gst-plugins1-libav/distinfo                              |   3 +-
 multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c |  30 ++++++++++
 3 files changed, 34 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r 5df704372787 -r 6e4b6be9bc2b multimedia/gst-plugins1-libav/Makefile
--- a/multimedia/gst-plugins1-libav/Makefile    Fri Nov 17 22:10:04 2017 +0000
+++ b/multimedia/gst-plugins1-libav/Makefile    Fri Nov 17 23:21:06 2017 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.35 2017/11/16 16:49:40 prlw1 Exp $
+# $NetBSD: Makefile,v 1.36 2017/11/17 23:21:06 prlw1 Exp $
 
 DISTNAME=      gst-libav-1.12.3
 PKGNAME=       ${DISTNAME:S/gst/gst-plugins1/}
+PKGREVISION=   1
 CATEGORIES=    multimedia
 MASTER_SITES=  https://gstreamer.freedesktop.org/src/gst-libav/
 EXTRACT_SUFX=  .tar.xz
diff -r 5df704372787 -r 6e4b6be9bc2b multimedia/gst-plugins1-libav/distinfo
--- a/multimedia/gst-plugins1-libav/distinfo    Fri Nov 17 22:10:04 2017 +0000
+++ b/multimedia/gst-plugins1-libav/distinfo    Fri Nov 17 23:21:06 2017 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.25 2017/11/16 16:49:40 prlw1 Exp $
+$NetBSD: distinfo,v 1.26 2017/11/17 23:21:06 prlw1 Exp $
 
 SHA1 (gst-libav-1.12.3.tar.xz) = 6816850a9927d61b8f85ba1cb9a50d0050221dd7
 RMD160 (gst-libav-1.12.3.tar.xz) = 66c3e475b9e4f5bdf5d356ceee1f4072d61ca949
 SHA512 (gst-libav-1.12.3.tar.xz) = 33b380b7094afe1db57103eeeca5ae13db98a5bee6785f884a7ec8abb93a94f702eb52f0515f4fa27a0f157ecb0757cf3576df335dc456254f9a82567f5ab7a8
 Size (gst-libav-1.12.3.tar.xz) = 8791724 bytes
 SHA1 (patch-configure) = 208c4d685538518698ae074c1e6b03e9a3c229bb
+SHA1 (patch-ext_libav_gstavviddec.c) = c397a6c7e027453353a79c5d64f7b1d648c21739
diff -r 5df704372787 -r 6e4b6be9bc2b multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c       Fri Nov 17 23:21:06 2017 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-ext_libav_gstavviddec.c,v 1.1 2017/11/17 23:21:06 prlw1 Exp $
+
+"quick & dirty hack to use new decoding API for viddec" from
+https://bugzilla.gnome.org/show_bug.cgi?id=789193
+
+--- ext/libav/gstavviddec.c.orig       2017-08-10 15:56:34.000000000 +0000
++++ ext/libav/gstavviddec.c
+@@ -1525,8 +1525,20 @@ gst_ffmpegviddec_video_frame (GstFFMpegV
+    * See https://bugzilla.gnome.org/show_bug.cgi?id=726020
+    */
+   GST_VIDEO_DECODER_STREAM_UNLOCK (ffmpegdec);
+-  len = avcodec_decode_video2 (ffmpegdec->context,
+-      ffmpegdec->picture, have_data, &packet);
++  *have_data = 0;
++  if (size > 0) {
++    len = avcodec_send_packet(ffmpegdec->context, &packet);
++    if (len == AVERROR(EAGAIN)) {
++      len = 0;
++    } else {
++      len = size;
++    }
++    if (len >= 0) {
++      int result = avcodec_receive_frame(ffmpegdec->context, ffmpegdec->picture);
++      if (result == 0)
++        *have_data = 1;
++    }
++  }
+   GST_VIDEO_DECODER_STREAM_LOCK (ffmpegdec);
+ 
+   GST_DEBUG_OBJECT (ffmpegdec, "after decode: len %d, have_data %d",



Home | Main Index | Thread Index | Old Index