pkgsrc-Changes archive

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

CVS commit: pkgsrc/multimedia/gst-plugins1-libav



Module Name:    pkgsrc
Committed By:   prlw1
Date:           Fri Nov 17 23:21:06 UTC 2017

Modified Files:
        pkgsrc/multimedia/gst-plugins1-libav: Makefile distinfo
Added Files:
        pkgsrc/multimedia/gst-plugins1-libav/patches:
            patch-ext_libav_gstavviddec.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 pkgsrc/multimedia/gst-plugins1-libav/Makefile
cvs rdiff -u -r1.25 -r1.26 pkgsrc/multimedia/gst-plugins1-libav/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/multimedia/gst-plugins1-libav/Makefile
diff -u pkgsrc/multimedia/gst-plugins1-libav/Makefile:1.35 pkgsrc/multimedia/gst-plugins1-libav/Makefile:1.36
--- pkgsrc/multimedia/gst-plugins1-libav/Makefile:1.35  Thu Nov 16 16:49:40 2017
+++ pkgsrc/multimedia/gst-plugins1-libav/Makefile       Fri Nov 17 23:21:06 2017
@@ -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

Index: pkgsrc/multimedia/gst-plugins1-libav/distinfo
diff -u pkgsrc/multimedia/gst-plugins1-libav/distinfo:1.25 pkgsrc/multimedia/gst-plugins1-libav/distinfo:1.26
--- pkgsrc/multimedia/gst-plugins1-libav/distinfo:1.25  Thu Nov 16 16:49:40 2017
+++ pkgsrc/multimedia/gst-plugins1-libav/distinfo       Fri Nov 17 23:21:06 2017
@@ -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

Added files:

Index: pkgsrc/multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c
diff -u /dev/null pkgsrc/multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c:1.1
--- /dev/null   Fri Nov 17 23:21:06 2017
+++ pkgsrc/multimedia/gst-plugins1-libav/patches/patch-ext_libav_gstavviddec.c  Fri Nov 17 23:21:06 2017
@@ -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