<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[148143] trunk/dports/multimedia/moc</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/148143">148143</a></dd>
<dt>Author</dt> <dd>devans@macports.org</dd>
<dt>Date</dt> <dd>2016-04-27 15:25:39 -0700 (Wed, 27 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>moc: update to version 2.6-alpha1, master_sites, livecheck, apply upstream patches for ffmpeg-3.0 compatibility (#51207, maintainer timeout).</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsmultimediamocPortfile">trunk/dports/multimedia/moc/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsmultimediamocfilespatchffmpeg30diff">trunk/dports/multimedia/moc/files/patch-ffmpeg-3.0.diff</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsmultimediamocfilespatchconfigurediff">trunk/dports/multimedia/moc/files/patch-configure.diff</a></li>
<li><a href="#trunkdportsmultimediamocfilespatchffmpegr2529diff">trunk/dports/multimedia/moc/files/patch-ffmpeg-r2529.diff</a></li>
<li><a href="#trunkdportsmultimediamocfilespatchoptionscdiff">trunk/dports/multimedia/moc/files/patch-options.c.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsmultimediamocPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/multimedia/moc/Portfile (148142 => 148143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/multimedia/moc/Portfile        2016-04-27 22:11:35 UTC (rev 148142)
+++ trunk/dports/multimedia/moc/Portfile        2016-04-27 22:25:39 UTC (rev 148143)
</span><span class="lines">@@ -3,8 +3,7 @@
</span><span class="cx"> PortSystem          1.0
</span><span class="cx"> 
</span><span class="cx"> name                moc
</span><del>-version             2.5.0-beta1
-revision            3
</del><ins>+version             2.6-alpha1
</ins><span class="cx"> license             GPL-2
</span><span class="cx"> categories          multimedia
</span><span class="cx"> maintainers         martinvazquez.net:eu
</span><span class="lines">@@ -19,13 +18,12 @@
</span><span class="cx"> 
</span><span class="cx"> homepage            http://moc.daper.net
</span><span class="cx"> platforms           darwin
</span><del>-master_sites        ftp://ftp.daper.net/pub/soft/moc/unstable/
</del><ins>+master_sites        http://ftp.daper.net/pub/soft/moc/unstable/
</ins><span class="cx"> 
</span><del>-checksums           md5     795ecba86847e082aa2f21937cc04804 \
-                    sha1    4030a1fa5c7cfef06909c54d8c7a1fbb93f23caa \
-                    rmd160  ca7095f71e5fe8155eda41e98547db541d6a4cab
</del><ins>+checksums           rmd160  283f9945abbd3b3d4e15f23485228c00983edfe8 \
+                    sha256  0b0a3515c65b4c47a250e350c663535778239352db859921f5d564ed727a0bbc
</ins><span class="cx"> 
</span><del>-use_bzip2           yes
</del><ins>+use_xz              yes
</ins><span class="cx"> 
</span><span class="cx"> depends_build            port:pkgconfig 
</span><span class="cx"> 
</span><span class="lines">@@ -41,7 +39,7 @@
</span><span class="cx">                     port:jack \
</span><span class="cx">                     port:curl
</span><span class="cx"> 
</span><del>-patchfiles            patch-ffmpeg-r2529.diff
</del><ins>+patchfiles          patch-ffmpeg-3.0.diff
</ins><span class="cx"> 
</span><span class="cx"> use_autoreconf            yes
</span><span class="cx"> autoreconf.args     -fvi
</span><span class="lines">@@ -59,4 +57,4 @@
</span><span class="cx">         configure.args-delete   --without-vorbis
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-livecheck.regex            &lt;title&gt;music on console (.*)&lt;/title&gt;
</del><ins>+livecheck.regex     &quot;&gt;${name}-\(\.*\)\.tar&quot;
</ins></span></pre></div>
<a id="trunkdportsmultimediamocfilespatchconfigurediff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/multimedia/moc/files/patch-configure.diff (148142 => 148143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/multimedia/moc/files/patch-configure.diff        2016-04-27 22:11:35 UTC (rev 148142)
+++ trunk/dports/multimedia/moc/files/patch-configure.diff        2016-04-27 22:25:39 UTC (rev 148143)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-diff -ur ../moc-2.4.3.orig/configure ./configure
---- ../moc-2.4.3.orig/configure        2007-07-30 17:49:11.000000000 +0200
-+++ ./configure        2008-03-26 19:32:00.000000000 +0100
-@@ -21998,7 +21998,7 @@
-                 ;
- esac

--LDFLAGS=&quot;$LDFLAGS -export-dynamic&quot;
-+LDFLAGS=&quot;$LDFLAGS ${export_dynamic_flag}&quot;

- { echo &quot;$as_me:$LINENO: checking for ANSI C header files&quot; &gt;&amp;5
- echo $ECHO_N &quot;checking for ANSI C header files... $ECHO_C&quot; &gt;&amp;6; }
</del></span></pre></div>
<a id="trunkdportsmultimediamocfilespatchffmpeg30diff"></a>
<div class="addfile"><h4>Added: trunk/dports/multimedia/moc/files/patch-ffmpeg-3.0.diff (0 => 148143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/multimedia/moc/files/patch-ffmpeg-3.0.diff                                (rev 0)
+++ trunk/dports/multimedia/moc/files/patch-ffmpeg-3.0.diff        2016-04-27 22:25:39 UTC (rev 148143)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+Index: configure.in
+===================================================================
+--- configure.in        (revision 2781)
++++ configure.in        (revision 2785)
+@@ -457,19 +457,3 @@
+         echo &quot;         you will not hear any sound!&quot;
+         echo
+ fi
+-
+-dnl
+-dnl  If the warning below gets reported, then for further guidance:
+-dnl
+-dnl         vi +/REQUEST_CHANNELS decoder_plugins/ffmpeg/ffmpeg.c
+-dnl
+-if test &quot;x$want_ffmpeg&quot; = &quot;xyes&quot; &amp;&amp; \
+-   test &quot;x$ac_cv_member_struct_AVCodecContext_request_channels&quot; != &quot;xyes&quot;
+-then
+-        echo &quot;WARNING: It appears that the FFmpeg/LibAV API has changed and no longer&quot;
+-        echo &quot;         supports downmixing to stereo as it did previously.  Report&quot;
+-        echo &quot;         this message along with the output of 'ffmpeg -version' to&quot;
+-        echo &quot;         &lt;$PACKAGE_BUGREPORT&gt;.  Meanwhile, you may have to live without&quot;
+-        echo &quot;         stereo downmixing.&quot;
+-        echo
+-fi
+Index: decoder_plugins/ffmpeg/ffmpeg.m4
+===================================================================
+--- decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2781)
++++ decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2785)
+@@ -39,6 +39,8 @@
+                 LIBS=&quot;$LIBS $ffmpeg_LIBS&quot;
+                 AC_CHECK_MEMBERS([struct AVCodecContext.request_channels], [], [],
+                              [#include &lt;libavcodec/avcodec.h&gt;])
++                AC_CHECK_HEADERS([ffmpeg/avformat.h \
++                                  libavformat/avformat.h libavutil/channel_layout.h])
+                 AC_SEARCH_LIBS(avcodec_open2, avcodec,
+                         [AC_DEFINE([HAVE_AVCODEC_OPEN2], 1,
+                                 [Define to 1 if you have the `avcodec_open2' function.])])
+@@ -46,6 +48,9 @@
+                         [AC_DEFINE([HAVE_AVCODEC_DECODE_AUDIO4], 1,
+                                 [Define to 1 if you have the `avcodec_decode_audio4' function.])],
+                         [AX_FUNC_POSIX_MEMALIGN])
++                AC_SEARCH_LIBS(av_packet_unref, avcodec,
++                        [AC_DEFINE([HAVE_AV_PACKET_UNREF], 1,
++                                [Define to 1 if you have the `av_packet_unref' function.])])
+                 AC_SEARCH_LIBS(avformat_close_input, avformat,
+                         [AC_DEFINE([HAVE_AVFORMAT_CLOSE_INPUT], 1,
+                                 [Define to 1 if you have the `avformat_close_input' function.])])
+Index: decoder_plugins/ffmpeg/ffmpeg.c
+===================================================================
+--- decoder_plugins/ffmpeg/ffmpeg.c        (revision 2781)
++++ decoder_plugins/ffmpeg/ffmpeg.c        (revision 2785)
+@@ -41,7 +41,11 @@
+ GCC_DIAG_ON(deprecated-declarations)
+ #include &lt;libavutil/mathematics.h&gt;
+ #ifdef HAVE_AV_GET_CHANNEL_LAYOUT_NB_CHANNELS
+-#include &lt;libavutil/audioconvert.h&gt;
++# if HAVE_LIBAVUTIL_CHANNEL_LAYOUT_H
++#  include &lt;libavutil/channel_layout.h&gt;
++# else
++#  include &lt;libavutil/audioconvert.h&gt;
++# endif
+ #endif

+ /* FFmpeg also likes common names, without that, our common.h and log.h
+@@ -769,32 +773,11 @@
+                 return;
+ #endif

+-        data-&gt;enc-&gt;channels = 2;
+-
+ #ifdef HAVE_STRUCT_AVCODECCONTEXT_REQUEST_CHANNELS
+-
+-        /*
+-         * When FFmpeg breaks its API (and it will), this code will be
+-         * disabled and users will complain that MOC no longer downmixes
+-         * to stereo.  This is because the 'request_channels' field in
+-         * AVCodecContext is marked as deprecated (and so will probably
+-         * be removed at some time) but FFmpeg requires it to be set to
+-         * trigger downmixing (go figure!).  Currently, there is no
+-         * guidance on how it will work in the future, but looking at
+-         * where 's-&gt;downmixed' is set near the end of 'ac3_decode_init()'
+-         * in the FFmpeg's source code file 'libavcodec/ac3dec.c' might
+-         * help (in the absence of proper documentation).
+-         */
+-
+         set_request_channels (data-&gt;enc, 2);
+-
+-#ifdef AV_CH_LAYOUT_STEREO_DOWNMIX
+-        data-&gt;enc-&gt;request_channel_layout = AV_CH_LAYOUT_STEREO_DOWNMIX;
+ #else
+-        data-&gt;enc-&gt;request_channel_layout = CH_LAYOUT_STEREO_DOWNMIX;
++        data-&gt;enc-&gt;request_channel_layout = AV_CH_LAYOUT_STEREO;
+ #endif
+-
+-#endif
+ }

+ static void *ffmpeg_open (const char *file)
+@@ -1064,7 +1047,12 @@
+ {
+         assert (pkt);

++#if HAVE_AV_PACKET_UNREF
++        av_packet_unref (pkt);
++#else
+         av_free_packet (pkt);
++#endif
++
+         free (pkt);
+ }

+Index: decoder_plugins/ffmpeg/ffmpeg.m4
+===================================================================
+--- decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2799)
++++ decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2800)
+@@ -39,8 +39,7 @@
+                 LIBS=&quot;$LIBS $ffmpeg_LIBS&quot;
+                 AC_CHECK_MEMBERS([struct AVCodecContext.request_channels], [], [],
+                              [#include &lt;libavcodec/avcodec.h&gt;])
+-                AC_CHECK_HEADERS([ffmpeg/avformat.h \
+-                                  libavformat/avformat.h libavutil/channel_layout.h])
++                AC_CHECK_HEADERS([libavutil/channel_layout.h])
+                 AC_SEARCH_LIBS(avcodec_open2, avcodec,
+                         [AC_DEFINE([HAVE_AVCODEC_OPEN2], 1,
+                                 [Define to 1 if you have the `avcodec_open2' function.])])
</ins></span></pre></div>
<a id="trunkdportsmultimediamocfilespatchffmpegr2529diff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/multimedia/moc/files/patch-ffmpeg-r2529.diff (148142 => 148143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/multimedia/moc/files/patch-ffmpeg-r2529.diff        2016-04-27 22:11:35 UTC (rev 148142)
+++ trunk/dports/multimedia/moc/files/patch-ffmpeg-r2529.diff        2016-04-27 22:25:39 UTC (rev 148143)
</span><span class="lines">@@ -1,904 +0,0 @@
</span><del>-Index: THANKS
-===================================================================
---- THANKS        (revision 2506)
-+++ THANKS        (revision 2529)
-@@ -10,6 +10,9 @@
-         * Fixed miscellaneous coding errors.
-         * Assisted with testing.

-+Gregory Maxwell:
-+        * Provided patch for off_t in io_* functions.
-+
- Morten Grunnet Buhl:
-         * Provided Yellow/Red theme.

-@@ -44,6 +47,7 @@
-         * Headed the effort to port MOC to OpenWRT.
-         * Provided signficant information on DTS, AAC and other formats.
-         * Also contributed much time in the refinement of feature ideas.
-+        * Provided 24-bit format conversion bug fixes.

- Juho Hämäläinen:
-         * Added -Q (--format) FORMAT_STRING option to display file information.
-@@ -202,6 +206,9 @@
-         * Fixed segfault when trying to play a file using FFmpeg.
-         * Migrated to newer FFmpeg API.

-+&quot;firejox&quot;
-+        * Fixed screen upsets due to UTF-8 character handing.
-+
- &quot;fluxid&quot;:
-         * Fixed incorrect setting for themes red channel value.

-Index: mocp.1
-===================================================================
---- mocp.1        (revision 2506)
-+++ mocp.1        (revision 2529)
-@@ -69,6 +69,11 @@
- set in the configuration file as \fBStartInMusicDir\fP.
- .LP
- .TP
-+\fB\-q\fP, \fB\-\-enqueue\fP
-+Add files given after command line options to the queue.  Don't start the
-+interface.
-+.LP
-+.TP
- \fB\-a\fP, \fB\-\-append\fP
- Append files, directories (recursively) and playlists given after command
- line options to the playlist.  Don't start the interface.
-Index: menu.c
-===================================================================
---- menu.c        (revision 2506)
-+++ menu.c        (revision 2529)
-@@ -90,9 +90,14 @@
-         getyx (menu-&gt;win, y, x);
-         if (title_width &lt;= title_space || mi-&gt;align == MENU_ALIGN_LEFT)
-                 xwaddnstr (menu-&gt;win, mi-&gt;title, title_space);
--        else
--                xwaddstr (menu-&gt;win, mi-&gt;title + title_width - title_space);
-+        else {
-+                char *ptr;

-+                ptr = xstrtail (mi-&gt;title, title_space);
-+                xwaddstr (menu-&gt;win, ptr);
-+                free (ptr);
-+        }
-+
-         /* Fill the remainder of the title field with spaces. */
-         if (mi == menu-&gt;selected) {
-                 getyx (menu-&gt;win, y, ix);
-Index: configure.in
-===================================================================
---- configure.in        (revision 2506)
-+++ configure.in        (revision 2529)
-@@ -142,7 +142,7 @@

- PKG_PROG_PKG_CONFIG([0.20])

--if test &quot;x$PKG_CONFIG&quot; == &quot;x&quot;
-+if test &quot;x$PKG_CONFIG&quot; = &quot;x&quot;
- then
-         AC_MSG_WARN([No pkg-config utility found or it's too old, I will have trouble finding installed libraries.])
- fi
-@@ -293,7 +293,6 @@

- dnl optional functions
- AC_CHECK_FUNCS([strcasestr strerror_r syslog])
--AC_CHECK_FUNCS([getrlimit pthread_attr_getstacksize])
- AX_CHECK_UNAME_SYSCALL

- dnl MIME magic
-@@ -322,6 +321,7 @@
- CC=&quot;$PTHREAD_CC&quot;
- CFLAGS=&quot;$PTHREAD_CFLAGS $CFLAGS&quot;
- EXTRA_LIBS=&quot;$EXTRA_LIBS $PTHREAD_LIBS&quot;
-+AC_CHECK_FUNCS([getrlimit pthread_attr_getstacksize])

- dnl __FUNCTION__
- AC_TRY_COMPILE(,[printf(__FUNCTION__);], [AC_DEFINE([HAVE__FUNCTION__], 1,
-@@ -342,7 +342,7 @@
- fi

- dnl popt
--AC_SEARCH_LIBS([poptGetContext], [popt], , [POPT_MISSING=&quot;yes&quot;])
-+AC_CHECK_LIB([popt], [poptGetContext], [true], [POPT_MISSING=&quot;yes&quot;])

- dnl getopt
- AC_CHECK_FUNC(getopt_long,
-Index: utf8.c
-===================================================================
---- utf8.c        (revision 2506)
-+++ utf8.c        (revision 2529)
-@@ -199,47 +199,50 @@

- int xwaddnstr (WINDOW *win, const char *str, const int n)
- {
--        int res;
-+        int res, width, inv_char;
-+        wchar_t *ucs;
-+        char *mstr, *lstr;
-+        size_t size, num_chars;

-         assert (n &gt; 0);
-         assert (str != NULL);

--        if (using_utf8) {
-+        mstr = iconv_str (iconv_desc, str);

--                /* This nasty hack is because we need to count n in chars, but
--                 * [w]addnstr() takes arguments in bytes (in UTF-8 a char can be
--                 * longer than 1 byte).  There are also problems with [w]addnwstr()
--                 * (screen garbled).  I have no better idea. */
-+        size = xmbstowcs (NULL, mstr, -1, NULL) + 1;
-+        ucs = (wchar_t *)xmalloc (sizeof(wchar_t) * size);
-+        xmbstowcs (ucs, mstr, size, &amp;inv_char);
-+        width = wcswidth (ucs, WIDTH_MAX);

--                wchar_t *ucs;
--                size_t size;
--                size_t utf_num_chars;
--                int inv_char;
--
--                size = xmbstowcs (NULL, str, -1, NULL) + 1;
--                ucs = (wchar_t *)xmalloc (sizeof(wchar_t) * size);
--                xmbstowcs (ucs, str, size, &amp;inv_char);
--                if ((size_t)n &lt; size - 1)
--                        ucs[n] = L'\0';
--                utf_num_chars = wcstombs (NULL, ucs, 0);
--                if (inv_char) {
--                        char *utf8 = (char *)xmalloc (utf_num_chars + 1);
--
--                        wcstombs (utf8, ucs, utf_num_chars + 1);
--                        res = waddstr (win, utf8);
--                        free (utf8);
-+        if (width == -1) {
-+                size_t clidx;
-+                for (clidx = 0; clidx &lt; size - 1; clidx++) {
-+                        if (wcwidth (ucs[clidx]) == -1)
-+                                ucs[clidx] = L'?';
-                 }
--                else
--                        res = waddnstr (win, str, utf_num_chars);
--                free (ucs);
-+                width = wcswidth (ucs, WIDTH_MAX);
-+                inv_char = 1;
-         }
--        else {
--                char *lstr = iconv_str (iconv_desc, str);

--                res = waddnstr (win, lstr, n);
--                free (lstr);
-+        if (width &gt; n) {
-+                while (width &gt; n)
-+                        width -= wcwidth (ucs[--size]);
-+                ucs[size] = L'\0';
-         }

-+        num_chars = wcstombs (NULL, ucs, 0);
-+        lstr = (char *)xmalloc (num_chars + 1);
-+
-+        if (inv_char)
-+                wcstombs (lstr, ucs, num_chars + 1);
-+        else
-+                snprintf (lstr, num_chars + 1, &quot;%s&quot;, mstr);
-+
-+        res = waddstr (win, lstr);
-+
-+        free (ucs);
-+        free (lstr);
-+        free (mstr);
-         return res;
- }

-Index: audio_conversion.c
-===================================================================
---- audio_conversion.c        (revision 2506)
-+++ audio_conversion.c        (revision 2529)
-@@ -189,7 +189,7 @@
-         size_t i;

-         /* maximum and minimum values of 32-bit samples */
--        const unsigned int U32_MAX = (1 &lt;&lt; 24);
-+        const unsigned int U32_MAX = (1 &lt;&lt; 24) - 1;
-         const int S32_MAX = (1 &lt;&lt; 23) - 1;
-         const int S32_MIN = -(1 &lt;&lt; 23);

-@@ -201,7 +201,7 @@
-                 float f = in[i] * S32_MAX;

-                 if (f &gt;= S32_MAX)
--                        *out_val = U32_MAX;
-+                        *out_val = U32_MAX &lt;&lt; 8;
-                 else if (f &lt;= S32_MIN)
-                         *out_val = 0;
-                 else {
-@@ -231,9 +231,9 @@
-                 float f = in[i] * S32_MAX;

-                 if (f &gt;= S32_MAX)
--                        *out_val = S32_MAX;
-+                        *out_val = S32_MAX &lt;&lt; 8;
-                 else if (f &lt;= S32_MIN)
--                        *out_val = S32_MIN;
-+                        *out_val = S32_MIN &lt;&lt; 8;
-                 else {
- #ifdef HAVE_LRINTF
-                         *out_val = lrintf(f) &lt;&lt; 8;
-Index: io.c
-===================================================================
---- io.c        (revision 2506)
-+++ io.c        (revision 2529)
-@@ -141,20 +141,20 @@
- }

- #ifdef HAVE_MMAP
--static off_t io_seek_mmap (struct io_stream *s, const long where)
-+static off_t io_seek_mmap (struct io_stream *s, const off_t where)
- {
--        assert (RANGE(0, where, (long)s-&gt;size));
-+        assert (RANGE(0, where, (off_t)s-&gt;size));

-         return (s-&gt;mem_pos = where);
- }
- #endif

--static off_t io_seek_fd (struct io_stream *s, const int where)
-+static off_t io_seek_fd (struct io_stream *s, const off_t where)
- {
-         return lseek (s-&gt;fd, where, SEEK_SET);
- }

--static off_t io_seek_buffered (struct io_stream *s, const long where)
-+static off_t io_seek_buffered (struct io_stream *s, const off_t where)
- {
-         off_t res = -1;

-@@ -180,7 +180,7 @@
-         return res;
- }

--static off_t io_seek_unbuffered (struct io_stream *s, const long where)
-+static off_t io_seek_unbuffered (struct io_stream *s, const off_t where)
- {
-         off_t res = -1;

-Index: decoder_plugins/mp3/mp3.c
-===================================================================
---- decoder_plugins/mp3/mp3.c        (revision 2506)
-+++ decoder_plugins/mp3/mp3.c        (revision 2529)
-@@ -696,17 +696,19 @@
- {
-         char *ext;

-+        strcpy (buf, &quot;MPx&quot;);
-+
-         ext = ext_pos (file);
--        if (!strcasecmp (ext, &quot;mp3&quot;))
--                strcpy (buf, &quot;MP3&quot;);
--        else if (!strcasecmp (ext, &quot;mp2&quot;))
--                strcpy (buf, &quot;MP2&quot;);
--        else if (!strcasecmp (ext, &quot;mp1&quot;))
--                strcpy (buf, &quot;MP1&quot;);
--        else if (!strcasecmp (ext, &quot;mpga&quot;))
--                strcpy (buf, &quot;MPG&quot;);
--        else
--                strcpy (buf, &quot;MPx&quot;);
-+        if (ext) {
-+                if (!strcasecmp (ext, &quot;mp3&quot;))
-+                        strcpy (buf, &quot;MP3&quot;);
-+                else if (!strcasecmp (ext, &quot;mp2&quot;))
-+                        strcpy (buf, &quot;MP2&quot;);
-+                else if (!strcasecmp (ext, &quot;mp1&quot;))
-+                        strcpy (buf, &quot;MP1&quot;);
-+                else if (!strcasecmp (ext, &quot;mpga&quot;))
-+                        strcpy (buf, &quot;MPG&quot;);
-+        }
- }

- static int mp3_our_format_ext (const char *ext)
-Index: decoder_plugins/ffmpeg/ffmpeg.m4
-===================================================================
---- decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2506)
-+++ decoder_plugins/ffmpeg/ffmpeg.m4        (revision 2529)
-@@ -88,6 +88,27 @@
-                                  [#include &lt;libavcodec/avcodec.h&gt;])
-                 AC_CHECK_DECLS([AV_CODEC_ID_OPUS], , ,
-                                  [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_SEARCH_LIBS(avcodec_free_frame, avcodec,
-+                        [AC_DEFINE([HAVE_AVCODEC_FREE_FRAME], 1,
-+                                [Define to 1 if you have the `avcodec_free_frame' function.])])
-+                AC_CHECK_DECLS([CODEC_ID_PCM_S8_PLANAR], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_CHECK_DECLS([AV_SAMPLE_FMT_U8P], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_CHECK_DECLS([AV_SAMPLE_FMT_S16P], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_CHECK_DECLS([AV_SAMPLE_FMT_S32P], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_CHECK_DECLS([AV_SAMPLE_FMT_FLTP], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_CHECK_DECLS([CODEC_CAP_EXPERIMENTAL], , ,
-+                                 [#include &lt;libavcodec/avcodec.h&gt;])
-+                AC_SEARCH_LIBS(av_get_sample_fmt_name, avutil,
-+                        [AC_DEFINE([HAVE_AV_GET_SAMPLE_FMT_NAME], 1,
-+                                [Define to 1 if you have the `av_get_sample_fmt_name' function.])])
-+                AC_SEARCH_LIBS(av_lockmgr_register, avcodec,
-+                        [AC_DEFINE([HAVE_LOCKMGR_REGISTER], 1,
-+                                [Define to 1 if you have the `av_lockmgr_register' function.])])
-                 CPPFLAGS=&quot;$save_CPPFLAGS&quot;
-                 CFLAGS=&quot;$save_CFLAGS&quot;
-                 LIBS=&quot;$save_LIBS&quot;
-Index: decoder_plugins/ffmpeg/ffmpeg.c
-===================================================================
---- decoder_plugins/ffmpeg/ffmpeg.c        (revision 2506)
-+++ decoder_plugins/ffmpeg/ffmpeg.c        (revision 2529)
-@@ -99,6 +99,7 @@
-         bool okay; /* was this stream successfully opened? */
-         struct decoder_error error;
-         long fmt;
-+        int sample_width;
-         int bitrate;            /* in bits per second */
-         int avg_bitrate;        /* in bits per second */
- #if SEEK_IN_DECODER
-@@ -106,6 +107,7 @@
-         int seek_sec;           /* second to which to seek */
- #endif
-         bool seek_broken;       /* FFmpeg seeking is broken */
-+        bool timing_broken;     /* FFmpeg trashes duration and bit_rate */
- #if SEEK_IN_DECODER &amp;&amp; defined(DEBUG)
-         pthread_t thread_id;
- #endif
-@@ -277,8 +279,72 @@
-         }
- }

-+/* Handle FFmpeg's locking requirements. */
-+#ifdef HAVE_LOCKMGR_REGISTER
-+static int locking_cb (void **mutex, enum AVLockOp op)
-+{
-+        int result;
-+
-+        switch (op) {
-+        case AV_LOCK_CREATE:
-+                *mutex = xmalloc (sizeof (pthread_mutex_t));
-+                result = pthread_mutex_init (*mutex, NULL);
-+                break;
-+        case AV_LOCK_OBTAIN:
-+                result = pthread_mutex_lock (*mutex);
-+                break;
-+        case AV_LOCK_RELEASE:
-+                result = pthread_mutex_unlock (*mutex);
-+                break;
-+        case AV_LOCK_DESTROY:
-+                result = pthread_mutex_destroy (*mutex);
-+                free (*mutex);
-+                *mutex = NULL;
-+                break;
-+        }
-+
-+        return result;
-+}
-+#endif
-+
-+/* Here we attempt to determine if FFmpeg/LibAV has trashed the 'duration'
-+ * and 'bit_rate' fields in AVFormatContext for large files.  Determining
-+ * whether or not they are likely to be valid is imprecise and will vary
-+ * depending (at least) on:
-+ *
-+ * - The file's size,
-+ * - The file's codec,
-+ * - The number and size of tags,
-+ * - The version of FFmpeg/LibAV, and
-+ * - Whether it's FFmpeg or LibAV.
-+ *
-+ * This function represents a best guess.
-+*/
-+static bool is_timing_broken (AVFormatContext *ic)
-+{
-+        int64_t file_size;
-+
-+        if (ic-&gt;duration &lt; 0 || ic-&gt;bit_rate &lt; 0)
-+                return true;
-+
-+#ifdef HAVE_AVIO_SIZE
-+        file_size = avio_size (ic-&gt;pb);
-+#else
-+        file_size = ic-&gt;file_size;
-+#endif
-+
-+        if (file_size &lt; UINT32_MAX)
-+                return false;
-+
-+        return true;
-+}
-+
- static void ffmpeg_init ()
- {
-+#ifdef HAVE_LOCKMGR_REGISTER
-+        int rc;
-+#endif
-+
- #ifdef DEBUG
-         av_log_set_level (AV_LOG_INFO);
- #else
-@@ -291,10 +357,20 @@
-         supported_extns = lists_strs_new (16);
-         load_audio_extns (supported_extns);
-         load_video_extns (supported_extns);
-+
-+#ifdef HAVE_LOCKMGR_REGISTER
-+        rc = av_lockmgr_register (locking_cb);
-+        if (rc &lt; 0)
-+                fatal (&quot;Lock manager initialisation failed&quot;);
-+#endif
- }

- static void ffmpeg_destroy ()
- {
-+#ifdef HAVE_LOCKMGR_REGISTER
-+        av_lockmgr_register (NULL);
-+#endif
-+
-         av_log_set_level (AV_LOG_QUIET);
-         ffmpeg_log_repeats (NULL);

-@@ -341,9 +417,9 @@
-         }
- #endif

--        if (tags_sel &amp; TAGS_TIME) {
-+        if (!is_timing_broken (ic) &amp;&amp; tags_sel &amp; TAGS_TIME) {
-                 info-&gt;time = -1;
--                if (ic-&gt;duration &gt;= 0)
-+                if (ic-&gt;duration != (int64_t)AV_NOPTS_VALUE &amp;&amp; ic-&gt;duration &gt;= 0)
-                         info-&gt;time = ic-&gt;duration / AV_TIME_BASE;
-         }

-@@ -426,12 +502,6 @@

- #endif

--        if (tags_sel &amp; TAGS_TIME) {
--                info-&gt;time = -1;
--                if (ic-&gt;duration != (int64_t)AV_NOPTS_VALUE &amp;&amp; ic-&gt;duration &gt;= 0)
--                        info-&gt;time = ic-&gt;duration / AV_TIME_BASE;
--        }
--
- end:
- #ifdef HAVE_AVFORMAT_CLOSE_INPUT
-         avformat_close_input (&amp;ic);
-@@ -450,6 +520,9 @@
-                 if (!strcmp (data-&gt;ic-&gt;iformat-&gt;name, &quot;wav&quot;)) {
-                         switch (data-&gt;enc-&gt;codec_id) {
-                         case CODEC_ID_PCM_S8:
-+#if HAVE_DECL_CODEC_ID_PCM_S8_PLANAR
-+                        case CODEC_ID_PCM_S8_PLANAR:
-+#endif
-                                 result = SFMT_S8;
-                                 break;
-                         case CODEC_ID_PCM_U8:
-@@ -456,6 +529,7 @@
-                                 result = SFMT_U8;
-                                 break;
-                         case CODEC_ID_PCM_S16LE:
-+                        case CODEC_ID_PCM_S16LE_PLANAR:
-                         case CODEC_ID_PCM_S16BE:
-                                 result = SFMT_S16;
-                                 break;
-@@ -490,15 +564,27 @@

-         switch (data-&gt;enc-&gt;sample_fmt) {
-         case AV_SAMPLE_FMT_U8:
-+#if HAVE_DECL_AV_SAMPLE_FMT_U8P
-+        case AV_SAMPLE_FMT_U8P:
-+#endif
-                 result = SFMT_U8;
-                 break;
-         case AV_SAMPLE_FMT_S16:
-+#if HAVE_DECL_AV_SAMPLE_FMT_S16P
-+        case AV_SAMPLE_FMT_S16P:
-+#endif
-                 result = SFMT_S16;
-                 break;
-         case AV_SAMPLE_FMT_S32:
-+#if HAVE_DECL_AV_SAMPLE_FMT_S32P
-+        case AV_SAMPLE_FMT_S32P:
-+#endif
-                 result = SFMT_S32;
-                 break;
-         case AV_SAMPLE_FMT_FLT:
-+#if HAVE_DECL_AV_SAMPLE_FMT_FLTP
-+        case AV_SAMPLE_FMT_FLTP:
-+#endif
-                 result = SFMT_FLOAT;
-                 break;
-         default:
-@@ -597,6 +683,7 @@
-         data-&gt;stream = NULL;
-         data-&gt;enc = NULL;
-         data-&gt;codec = NULL;
-+        data-&gt;sample_width = 0;
-         data-&gt;bitrate = 0;
-         data-&gt;avg_bitrate = 0;

-@@ -624,6 +711,7 @@
-         data-&gt;seek_sec = 0;
- #endif
-         data-&gt;seek_broken = false;
-+        data-&gt;timing_broken = false;

-         decoder_error_init (&amp;data-&gt;error);

-@@ -655,6 +743,9 @@
-         err = av_find_stream_info (data-&gt;ic);
- #endif
-         if (err &lt; 0) {
-+                /* Depending on the particular FFmpeg/LibAV version in use, this
-+                 * may misreport experimental codecs.  Given we don't know the
-+                 * codec at this time, we will have to live with it. */
-                 decoder_error (&amp;data-&gt;error, ERROR_FATAL, 0,
-                                 &quot;Could not find codec parameters (err %d)&quot;,
-                                 err);
-@@ -683,6 +774,19 @@
-         debug (&quot;FFmpeg thinks '%s' is format(codec) '%s(%s)'&quot;,
-                 fn, data-&gt;ic-&gt;iformat-&gt;name, data-&gt;codec-&gt;name);

-+#if HAVE_DECL_CODEC_CAP_EXPERIMENTAL
-+        /* This may or may not work depending on the particular version of
-+         * FFmpeg/LibAV in use.  For some versions this will be caught in
-+         * *_find_stream_info() above and misreported as an unfound codec
-+         * parameters error. */
-+        if (data-&gt;codec-&gt;capabilities &amp; CODEC_CAP_EXPERIMENTAL) {
-+                decoder_error (&amp;data-&gt;error, ERROR_FATAL, 0,
-+                                &quot;The codec is experimental and may damage MOC: %s&quot;,
-+                                data-&gt;codec-&gt;name);
-+                goto end;
-+        }
-+#endif
-+
-         set_downmixing (data);
-         if (data-&gt;codec-&gt;capabilities &amp; CODEC_CAP_TRUNCATED)
-                 data-&gt;enc-&gt;flags |= CODEC_FLAG_TRUNCATED;
-@@ -702,27 +806,38 @@
-         if (data-&gt;fmt == 0)
-                 data-&gt;fmt = fmt_from_sample_fmt (data);
-         if (data-&gt;fmt == 0) {
-+#ifdef HAVE_AV_GET_SAMPLE_FMT_NAME
-                 decoder_error (&amp;data-&gt;error, ERROR_FATAL, 0,
-+                               &quot;Cannot get sample size from unknown sample format: %s&quot;,
-+                               av_get_sample_fmt_name (data-&gt;enc-&gt;sample_fmt));
-+#else
-+                decoder_error (&amp;data-&gt;error, ERROR_FATAL, 0,
-                                &quot;Unsupported sample size!&quot;);
-+#endif
-+                avcodec_close (data-&gt;enc);
-                 goto end;
-         }
-+        data-&gt;sample_width = sfmt_Bps (data-&gt;fmt);
-         if (data-&gt;codec-&gt;capabilities &amp; CODEC_CAP_DELAY)
-                 data-&gt;delay = true;
-         data-&gt;seek_broken = is_seek_broken (data);
-+        data-&gt;timing_broken = is_timing_broken (data-&gt;ic);

-         data-&gt;okay = true;

--        if (data-&gt;ic-&gt;duration &gt;= AV_TIME_BASE) {
-+        if (!data-&gt;timing_broken &amp;&amp; data-&gt;ic-&gt;duration &gt;= AV_TIME_BASE) {
- #ifdef HAVE_AVIO_SIZE
-                 data-&gt;avg_bitrate = (int) (avio_size (data-&gt;ic-&gt;pb) /
--                                          (data-&gt;ic-&gt;duration / AV_TIME_BASE) * 8);
-+                                           (data-&gt;ic-&gt;duration / AV_TIME_BASE) * 8);
- #else
-                 data-&gt;avg_bitrate = (int) (data-&gt;ic-&gt;file_size /
--                                          (data-&gt;ic-&gt;duration / AV_TIME_BASE) * 8);
-+                                           (data-&gt;ic-&gt;duration / AV_TIME_BASE) * 8);
- #endif
-         }
--        data-&gt;bitrate = data-&gt;ic-&gt;bit_rate;

-+        if (!data-&gt;timing_broken &amp;&amp; data-&gt;ic-&gt;bit_rate &gt; 0)
-+                data-&gt;bitrate = data-&gt;ic-&gt;bit_rate;
-+
-         return data;

- end:
-@@ -908,8 +1023,6 @@
-                                             &amp;data_size, pkt-&gt;data, pkt-&gt;size);
- #endif

--                debug (&quot;Decoded %dB&quot;, data_size);
--
-                 if (len &lt; 0)  {
-                         /* skip frame */
-                         decoder_error (&amp;data-&gt;error, ERROR_STREAM, 0, &quot;Error in the stream!&quot;);
-@@ -916,14 +1029,16 @@
-                         break;
-                 }

-+                debug (&quot;Decoded %dB&quot;, data_size);
-+
-+                pkt-&gt;data += len;
-+                pkt-&gt;size -= len;
-+
-                 if (data-&gt;eof &amp;&amp; data_size == 0) {
-                         data-&gt;eos = true;
-                         break;
-                 }

--                pkt-&gt;data += len;
--                pkt-&gt;size -= len;
--
-                 copied = copy_or_buffer (data, data-&gt;avbuf, data_size, buf, buf_len);

-                 buf += copied;
-@@ -943,12 +1058,15 @@
-                           char *buf, int buf_len)
- {
-         int filled = 0;
-+        char *packed;
-+        AVFrame *frame;

-+        frame = avcodec_alloc_frame ();
-+
-         do {
--                int len, got_frame, is_planar, plane_size, data_size, copied;
--                AVFrame frame;
-+                int len, got_frame, is_planar, packed_size, copied;

--                len = avcodec_decode_audio4 (data-&gt;enc, &amp;frame, &amp;got_frame, pkt);
-+                len = avcodec_decode_audio4 (data-&gt;enc, frame, &amp;got_frame, pkt);

-                 if (len &lt; 0)  {
-                         /* skip frame */
-@@ -956,45 +1074,56 @@
-                         break;
-                 }

--                if (!got_frame) {
--                        data-&gt;eos = data-&gt;eof;
--                        break;
--                }
--
-                 debug (&quot;Decoded %dB&quot;, len);

-                 pkt-&gt;data += len;
-                 pkt-&gt;size -= len;

--                is_planar = av_sample_fmt_is_planar (data-&gt;enc-&gt;sample_fmt);
--                data_size = av_samples_get_buffer_size (&amp;plane_size,
--                                                        data-&gt;enc-&gt;channels,                                                   frame.nb_samples,
--                                                        data-&gt;enc-&gt;sample_fmt, 1);
-+                if (!got_frame) {
-+                        data-&gt;eos = data-&gt;eof &amp;&amp; (pkt-&gt;size == 0);
-+                        continue;
-+                }

--                if (data_size == 0)
-+                if (frame-&gt;nb_samples == 0)
-                         continue;

--                copied = copy_or_buffer (data, (char *)frame.extended_data[0],
--                                         plane_size, buf, buf_len);
-+                is_planar = av_sample_fmt_is_planar (data-&gt;enc-&gt;sample_fmt);
-+                packed = (char *)frame-&gt;extended_data[0];
-+                packed_size = frame-&gt;nb_samples * data-&gt;sample_width
-+                                                * data-&gt;enc-&gt;channels;
-+
-+                if (is_planar &amp;&amp; data-&gt;enc-&gt;channels &gt; 1) {
-+                        int sample, ch;
-+
-+                        packed = xmalloc (packed_size);
-+
-+                        for (sample = 0; sample &lt; frame-&gt;nb_samples; sample += 1) {
-+                                for (ch = 0; ch &lt; data-&gt;enc-&gt;channels; ch += 1)
-+                                        memcpy (packed + (sample * data-&gt;enc-&gt;channels + ch)
-+                                                                 * data-&gt;sample_width,
-+                                                (char *)frame-&gt;extended_data[ch] + sample * data-&gt;sample_width,
-+                                                data-&gt;sample_width);
-+                        }
-+                }
-+
-+                copied = copy_or_buffer (data, packed, packed_size, buf, buf_len);
-                 buf += copied;
-                 filled += copied;
-                 buf_len -= copied;

--        if (is_planar &amp;&amp; data-&gt;enc-&gt;channels &gt; 1) {
--                        int ch;
-+                debug (&quot;Copying %dB (%dB filled)&quot;, packed_size, filled);

--            for (ch = 1; ch &lt; data-&gt;enc-&gt;channels; ch += 1) {
--                                copied = copy_or_buffer (data, (char *)frame.extended_data[ch],
--                                                         plane_size, buf, buf_len);
--                                buf += copied;
--                                filled += copied;
--                                buf_len -= copied;
--            }
--        }
--
--                debug (&quot;Copying %dB (%dB filled)&quot;, data_size, filled);
-+                if (packed != (char *)frame-&gt;extended_data[0])
-+                        free (packed);
-         } while (pkt-&gt;size &gt; 0);

-+        avcodec_get_frame_defaults (frame);
-+#ifdef HAVE_AVCODEC_FREE_FRAME
-+        avcodec_free_frame (&amp;frame);
-+#else
-+        av_freep (&amp;frame);
-+#endif
-+
-         return filled;
- }
- #endif
-@@ -1122,9 +1251,10 @@
-                 free_packet (pkt);
-         } while (!bytes_produced &amp;&amp; !data-&gt;eos);

--        data-&gt;bitrate = compute_bitrate (sound_params, bytes_used,
--                                         bytes_produced + data-&gt;remain_buf_len,
--                                         data-&gt;bitrate);
-+        if (!data-&gt;timing_broken)
-+                data-&gt;bitrate = compute_bitrate (sound_params, bytes_used,
-+                                                 bytes_produced + data-&gt;remain_buf_len,
-+                                                 data-&gt;bitrate);

-         return bytes_produced;
- }
-@@ -1185,7 +1315,7 @@
- {
-         struct ffmpeg_data *data = (struct ffmpeg_data *)prv_data;

--        return data-&gt;bitrate / 1000;
-+        return data-&gt;timing_broken ? -1 : data-&gt;bitrate / 1000;
- }

- static int ffmpeg_get_avg_bitrate (void *prv_data)
-@@ -1192,7 +1322,7 @@
- {
-         struct ffmpeg_data *data = (struct ffmpeg_data *)prv_data;

--        return data-&gt;avg_bitrate / 1000;
-+        return data-&gt;timing_broken ? -1 : data-&gt;avg_bitrate / 1000;
- }

- static int ffmpeg_get_duration (void *prv_data)
-@@ -1199,6 +1329,9 @@
- {
-         struct ffmpeg_data *data = (struct ffmpeg_data *)prv_data;

-+        if (data-&gt;timing_broken)
-+                return -1;
-+
-         if (!data-&gt;stream)
-                 return -1;

-Index: decoder_plugins/vorbis/vorbis.c
-===================================================================
---- decoder_plugins/vorbis/vorbis.c        (revision 2506)
-+++ decoder_plugins/vorbis/vorbis.c        (revision 2529)
-@@ -47,9 +47,9 @@

- /* Tremor defines time as 64-bit integer milliseconds. */
- #ifndef HAVE_TREMOR
--static const double time_scaler = 1;
-+static const int64_t time_scaler = 1;
- #else
--static const ogg_int64_t time_scaler = 1000;
-+static const int64_t time_scaler = 1000;
- #endif

- struct vorbis_data
-@@ -171,11 +171,11 @@
-                 get_comment_tags (&amp;vf, info);

-         if (tags_sel &amp; TAGS_TIME) {
--                int vorbis_time;
-+                int64_t vorbis_time;

--            vorbis_time = ov_time_total (&amp;vf, -1) / time_scaler;
--            if (vorbis_time &gt;= 0)
--                        info-&gt;time = vorbis_time;
-+                vorbis_time = ov_time_total (&amp;vf, -1);
-+                if (vorbis_time &gt;= 0)
-+                        info-&gt;time = vorbis_time / time_scaler;
-         }

-         ov_clear (&amp;vf);
-@@ -244,12 +244,15 @@
-                 io_close (data-&gt;stream);
-         }
-         else {
-+                int64_t duration;
-+
-                 data-&gt;last_section = -1;
-                 data-&gt;avg_bitrate = ov_bitrate (&amp;data-&gt;vf, -1) / 1000;
-                 data-&gt;bitrate = data-&gt;avg_bitrate;
--                data-&gt;duration = ov_time_total (&amp;data-&gt;vf, -1) / time_scaler;
--                if (data-&gt;duration == OV_EINVAL)
--                        data-&gt;duration = -1;
-+                data-&gt;duration = -1;
-+                duration = ov_time_total (&amp;data-&gt;vf, -1);
-+                if (duration &gt;= 0)
-+                        data-&gt;duration = duration / time_scaler;
-                 data-&gt;ok = 1;
-                 get_comment_tags (&amp;data-&gt;vf, data-&gt;tags);
-         }
-@@ -280,9 +283,9 @@

- static int vorbis_can_decode (struct io_stream *stream)
- {
--        char buf[34];
-+        char buf[35];

--        if (io_peek (stream, buf, 34) == 34 &amp;&amp; !memcmp (buf, &quot;OggS&quot;, 4)
-+        if (io_peek (stream, buf, 35) == 35 &amp;&amp; !memcmp (buf, &quot;OggS&quot;, 4)
-                         &amp;&amp; !memcmp (buf + 28, &quot;\01vorbis&quot;, 7))
-                 return 1;

-Index: decoder_plugins/flac/flac.c
-===================================================================
---- decoder_plugins/flac/flac.c        (revision 2506)
-+++ decoder_plugins/flac/flac.c        (revision 2529)
-@@ -54,7 +54,7 @@
-         int abort; /* abort playing (due to an error) */

-         unsigned length;
--        unsigned total_samples;
-+        FLAC__uint64 total_samples;

-         FLAC__byte sample_buffer[SAMPLE_BUFFER_SIZE];
-         unsigned sample_buffer_fill;
-@@ -156,11 +156,8 @@
-         if (metadata-&gt;type == FLAC__METADATA_TYPE_STREAMINFO) {
-                 debug (&quot;Got metadata info&quot;);

--                data-&gt;total_samples =
--                        (unsigned)(metadata-&gt;data.stream_info.total_samples
--                                   &amp; 0xffffffff);
--                data-&gt;bits_per_sample =
--                        metadata-&gt;data.stream_info.bits_per_sample;
-+                data-&gt;total_samples = metadata-&gt;data.stream_info.total_samples;
-+                data-&gt;bits_per_sample = metadata-&gt;data.stream_info.bits_per_sample;
-                 data-&gt;channels = metadata-&gt;data.stream_info.channels;
-                 data-&gt;sample_rate = metadata-&gt;data.stream_info.sample_rate;
-                 data-&gt;length = data-&gt;total_samples / data-&gt;sample_rate;
-@@ -536,9 +533,10 @@
-         if ((unsigned)sec &gt; data-&gt;length)
-                 return -1;

--        target_sample = (FLAC__uint64)((sec/(double)data-&gt;length) *
--                        (double)data-&gt;total_samples);
-+        target_sample = (FLAC__uint64)(((double)sec / (double)data-&gt;length) *
-+                                       (double)data-&gt;total_samples);

-+
- #ifdef LEGACY_FLAC
-         if (FLAC__seekable_stream_decoder_seek_absolute(data-&gt;decoder,
-                                 target_sample))
-Index: audio.c
-===================================================================
---- audio.c        (revision 2506)
-+++ audio.c        (revision 2529)
-@@ -169,7 +169,7 @@
-         if (fmt1 &amp; (SFMT_S16 | SFMT_U16)
-                         &amp;&amp; fmt2 &amp; (SFMT_S16 | SFMT_U16))
-                 return 1;
--        if (fmt1 &amp; (SFMT_S8 | SFMT_U8)
-+        if (fmt1 &amp; (SFMT_S32 | SFMT_U32)
-                         &amp;&amp; fmt2 &amp; (SFMT_S32 | SFMT_U32))
-                 return 1;
-         if (fmt1 &amp; fmt2 &amp; SFMT_FLOAT)
-Index: TODO
-===================================================================
---- TODO        (revision 2506)
-+++ TODO        (revision 2529)
-@@ -9,8 +9,6 @@
-   - Recognition of ID3 tags v1 is broken (example: small.mp3).  [node/234]
-   - Perhaps MOC can add support for the frame field_type to differentiate
-     between ID3_FIELD_TYPE_LATIN1 and ID3_FIELD_TYPE_STRING.  [node/234]
--  - Characters which are represented in more than one screen column cause
--    the text to overflow its field.  [node/82, 99 and 788]
-   - Some Cyrillic characters in file and directory names don't get displayed
-     correctly.
- * Program crashes:
</del></span></pre></div>
<a id="trunkdportsmultimediamocfilespatchoptionscdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/multimedia/moc/files/patch-options.c.diff (148142 => 148143)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/multimedia/moc/files/patch-options.c.diff        2016-04-27 22:11:35 UTC (rev 148142)
+++ trunk/dports/multimedia/moc/files/patch-options.c.diff        2016-04-27 22:25:39 UTC (rev 148143)
</span><span class="lines">@@ -1,14 +0,0 @@
</span><del>-diff -ur ../moc-2.4.3.orig/options.c ./options.c
---- ../moc-2.4.3.orig/options.c        2007-05-22 20:24:34.000000000 +0200
-+++ ./options.c        2008-03-26 20:02:14.000000000 +0100
-@@ -172,8 +172,8 @@
-         option_add_int (&quot;SyncPlaylist&quot;, 1);
-         option_add_int (&quot;InputBuffer&quot;, 512);
-         option_add_int (&quot;Prebuffering&quot;, 64);
--        option_add_str (&quot;JackOutLeft&quot;, &quot;alsa_pcm:playback_1&quot;);
--        option_add_str (&quot;JackOutRight&quot;, &quot;alsa_pcm:playback_2&quot;);
-+        option_add_str (&quot;JackOutLeft&quot;, &quot;system:playback_1&quot;);
-+        option_add_str (&quot;JackOutRight&quot;, &quot;system:playback_2&quot;);
-         option_add_int (&quot;ASCIILines&quot;, 0);
-         option_add_str (&quot;FastDir1&quot;, NULL);
-         option_add_str (&quot;FastDir2&quot;, NULL);
</del></span></pre>
</div>
</div>

</body>
</html>