rpms/audacious-plugins-freeworld/devel audacious-plugins-3.2-ffmpeg-0.8.8.patch, NONE, 1.1 .cvsignore, 1.12, 1.13 audacious-plugins-freeworld.spec, 1.21, 1.22 sources, 1.12, 1.13

Hans de Goede jwrdegoede at rpmfusion.org
Sun Jan 29 21:07:10 CET 2012


Author: jwrdegoede

Update of /cvs/free/rpms/audacious-plugins-freeworld/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv21821

Modified Files:
	.cvsignore audacious-plugins-freeworld.spec sources 
Added Files:
	audacious-plugins-3.2-ffmpeg-0.8.8.patch 
Log Message:
* Sun Jan 29 2012 Hans de Goede <j.w.r.degoede at gmail.com> 3.2-1
- Upgrade to 3.2


audacious-plugins-3.2-ffmpeg-0.8.8.patch:
 configure                  |   16 +++---
 src/ffaudio/ffaudio-core.c |  105 +++++++++++++++++++++++++++++++++++++++------
 2 files changed, 100 insertions(+), 21 deletions(-)

--- NEW FILE audacious-plugins-3.2-ffmpeg-0.8.8.patch ---
diff -up audacious-plugins-3.2/configure.orig audacious-plugins-3.2/configure
--- audacious-plugins-3.2/configure.orig	2012-01-29 20:59:35.962585477 +0100
+++ audacious-plugins-3.2/configure	2012-01-29 20:46:55.212595670 +0100
@@ -10914,12 +10914,12 @@ if test -n "$FFMPEG_CFLAGS"; then
     pkg_cv_FFMPEG_CFLAGS="$FFMPEG_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_FFMPEG_CFLAGS=`$PKG_CONFIG --cflags "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>/dev/null`
+  pkg_cv_FFMPEG_CFLAGS=`$PKG_CONFIG --cflags "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -10931,12 +10931,12 @@ if test -n "$FFMPEG_LIBS"; then
     pkg_cv_FFMPEG_LIBS="$FFMPEG_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_FFMPEG_LIBS=`$PKG_CONFIG --libs "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>/dev/null`
+  pkg_cv_FFMPEG_LIBS=`$PKG_CONFIG --libs "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -10957,9 +10957,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>&1`
+	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>&1`
         else
-	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavcodec >= 53.40.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>&1`
+	        FFMPEG_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libavcodec >= 53.8.0 libavformat >= 53.5.0 libavutil >= 50.42.0" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$FFMPEG_PKG_ERRORS" >&5
diff -up audacious-plugins-3.2/src/ffaudio/ffaudio-core.c.orig audacious-plugins-3.2/src/ffaudio/ffaudio-core.c
--- audacious-plugins-3.2/src/ffaudio/ffaudio-core.c.orig	2012-01-20 20:48:30.000000000 +0100
+++ audacious-plugins-3.2/src/ffaudio/ffaudio-core.c	2012-01-29 20:56:28.256588042 +0100
@@ -40,6 +40,14 @@
 #endif
 #include <libaudcore/audstrings.h>
 
+#if ! CHECK_LIBAVFORMAT_VERSION (53, 5, 0)
+#define avformat_find_stream_info(i, o) av_find_stream_info (i)
+#endif
+
+#if ! CHECK_LIBAVCODEC_VERSION (53, 8, 0)
+#define avcodec_open2(a, c, o) avcodec_open (a, c)
+#endif
+
 static GMutex *ctrl_mutex = NULL;
 static GCond *ctrl_cond = NULL;
 static gint64 seek_value = -1;
@@ -423,8 +431,11 @@ static gboolean ffaudio_play (InputPlayb
     AVCodecContext *c = NULL;
     AVStream *s = NULL;
     AVPacket pkt = {.data = NULL};
+    guint8 *outbuf = NULL, *resbuf = NULL;
     gint i, stream_id, errcount;
-    gboolean codec_opened = FALSE;
+    gint in_sample_size, out_sample_size, chunk_size;
+    ReSampleContext *resctx = NULL;
+    gboolean codec_opened = FALSE, do_resampling = FALSE;
     gint out_fmt;
     gboolean seekable;
     gboolean error = FALSE;
@@ -460,14 +471,37 @@ static gboolean ffaudio_play (InputPlayb
 
     codec_opened = TRUE;
 
+    /* Determine if audio conversion or resampling is needed */
+    in_sample_size = av_get_bytes_per_sample (c->sample_fmt);
+    out_sample_size = av_get_bytes_per_sample (SAMPLE_FMT_S16);
+
+    chunk_size = out_sample_size * c->channels * (c->sample_rate / 50);
+
     switch (c->sample_fmt) {
         case SAMPLE_FMT_U8: out_fmt = FMT_U8; break;
         case SAMPLE_FMT_S16: out_fmt = FMT_S16_NE; break;
         case SAMPLE_FMT_S32: out_fmt = FMT_S32_NE; break;
         case SAMPLE_FMT_FLT: out_fmt = FMT_FLOAT; break;
-    default:
-        fprintf (stderr, "ffaudio: Unsupported audio format %d\n", (int) c->sample_fmt);
-        goto error_exit;
+        default: do_resampling = TRUE; break;
+    }
+
+    if (do_resampling)
+    {
+        /* Initialize resampling context */
+        out_fmt = FMT_S16_NE;
+
+        AUDDBG("resampling needed chn=%d, rate=%d, fmt=%d -> chn=%d, rate=%d, fmt=S16NE\n",
+            c->channels, c->sample_rate, c->sample_fmt,
+            c->channels, c->sample_rate);
+
+        resctx = av_audio_resample_init(
+            c->channels, c->channels,
+            c->sample_rate, c->sample_rate,
+            SAMPLE_FMT_S16, c->sample_fmt,
+            16, 10, 0, 0.8);
+
+        if (resctx == NULL)
+            goto error_exit;
     }
 
     /* Open audio output */
@@ -481,6 +515,10 @@ static gboolean ffaudio_play (InputPlayb
 
     playback->set_gain_from_playlist(playback);
 
+    /* Allocate output buffer aligned to 16 byte boundary */
+    outbuf = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
+    resbuf = av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
+
     AUDDBG("setting parameters\n");
 
     if (pause)
@@ -553,6 +591,9 @@ static gboolean ffaudio_play (InputPlayb
         memcpy(&tmp, &pkt, sizeof(tmp));
         while (tmp.size > 0 && !stop_flag)
         {
+            gint len, out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+            guint8 *outbuf_p;
+
             /* Check for seek request and bail out if we have one */
             g_mutex_lock(ctrl_mutex);
             if (seek_value != -1)
@@ -570,25 +611,59 @@ static gboolean ffaudio_play (InputPlayb
             }
             g_mutex_unlock(ctrl_mutex);
 
-            AVFrame * frame = avcodec_alloc_frame ();
-            int decoded = 0;
-            int len = avcodec_decode_audio4 (c, frame, & decoded, & tmp);
-
+            /* Decode whatever we can of the frame data */
+            len = avcodec_decode_audio3(c, (gint16 *)outbuf, &out_size, &tmp);
             if (len < 0)
             {
-                fprintf (stderr, "ffaudio: decode_audio() failed, code %d\n", len);
+                AUDDBG("codec failure, breaking out of loop\n");
                 break;
             }
 
             tmp.size -= len;
             tmp.data += len;
 
-            if (! decoded)
+            if (out_size <= 0)
                 continue;
 
-            playback->output->write_audio (frame->data[0], FMT_SIZEOF (out_fmt)
-             * c->channels * frame->nb_samples);
-            av_free (frame);
+            /* Perform audio resampling if necessary */
+            if (do_resampling)
+            {
+                out_size = audio_resample(resctx,
+                    (gint16 *)resbuf, (gint16 *)outbuf,
+                    out_size / in_sample_size) * out_sample_size;
+                outbuf_p = resbuf;
+            }
+            else
+                outbuf_p = outbuf;
+
+            /* Output audio in small blocks */
+            while (out_size > 0 && !stop_flag && (stop_time < 0 ||
+             playback->output->written_time () < stop_time))
+            {
+                gint writeoff = MIN (chunk_size, out_size);
+
+                playback->output->write_audio((gint16 *)outbuf_p, writeoff);
+
+                outbuf_p += writeoff;
+                out_size -= writeoff;
+
+                /* Check for seek request and bail out if we have one */
+                g_mutex_lock(ctrl_mutex);
+                if (seek_value != -1)
+                {
+                    if (!seekable)
+                    {
+                        seek_value = -1;
+                        g_cond_signal(ctrl_cond);
+                    }
+                    else
+                    {
+                        g_mutex_unlock(ctrl_mutex);
+                        break;
+                    }
+                }
+                g_mutex_unlock(ctrl_mutex);
+            }
         }
 
         if (pkt.data)
@@ -611,6 +686,10 @@ error_exit:
 
     stop_flag = TRUE;
 
+    av_free(outbuf);
+    av_free(resbuf);
+    if (resctx != NULL)
+        audio_resample_close(resctx);
     if (pkt.data)
         av_free_packet(&pkt);
     if (codec_opened)


Index: .cvsignore
===================================================================
RCS file: /cvs/free/rpms/audacious-plugins-freeworld/devel/.cvsignore,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- .cvsignore	3 Nov 2011 11:24:10 -0000	1.12
+++ .cvsignore	29 Jan 2012 20:07:10 -0000	1.13
@@ -1 +1 @@
-audacious-plugins-3.0.4.tar.gz
+audacious-plugins-3.2.tar.bz2


Index: audacious-plugins-freeworld.spec
===================================================================
RCS file: /cvs/free/rpms/audacious-plugins-freeworld/devel/audacious-plugins-freeworld.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- audacious-plugins-freeworld.spec	18 Nov 2011 16:01:01 -0000	1.21
+++ audacious-plugins-freeworld.spec	29 Jan 2012 20:07:10 -0000	1.22
@@ -4,18 +4,22 @@
 %endif
 
 Name:           audacious-plugins-freeworld
-Version:        3.0.4
+Version:        3.2
 Release:        1%{?dist}
 Summary:        Additional plugins for the Audacious media player
 
 Group:          Applications/Multimedia
 License:        GPLv3
 URL:            http://audacious-media-player.org/
-Source0:        http://distfiles.atheme.org/audacious-plugins-%{version}.tar.gz
+Source0:        http://distfiles.audacious-media-player.org/audacious-plugins-%{version}.tar.bz2
 Source1:        audacious-mp3.desktop
 Source2:        audacious-aac.desktop
 Source3:        audacious-ffaudio.desktop
 
+# Revert 166902832b0e94d090acaf1c31688e70668388ac
+# (this can be dropped once we have ffmpeg-0.9.x in rpmfusion)
+Patch0:         audacious-plugins-3.2-ffmpeg-0.8.8.patch
+
 BuildRequires:  audacious-devel >= %{version}
 BuildRequires:  zlib-devel, libxml2-devel, desktop-file-utils >= 0.9
 BuildRequires:  taglib-devel >= 1.4
@@ -103,6 +107,7 @@
 
 %prep
 %setup -q -n audacious-plugins-%{version}
+%patch0 -p1
 sed -i '\,^.SILENT:,d' buildsys.mk.in
 
 
@@ -182,6 +187,9 @@
 
 
 %changelog
+* Sun Jan 29 2012 Hans de Goede <j.w.r.degoede at gmail.com> 3.2-1
+- Upgrade to 3.2
+
 * Thu Nov  3 2011 Hans de Goede <j.w.r.degoede at gmail.com> 3.0.4-1
 - Upgrade to 3.0.4
 


Index: sources
===================================================================
RCS file: /cvs/free/rpms/audacious-plugins-freeworld/devel/sources,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- sources	3 Nov 2011 11:24:10 -0000	1.12
+++ sources	29 Jan 2012 20:07:10 -0000	1.13
@@ -1 +1 @@
-f269ae195a7077ccefb28a44634c0785  audacious-plugins-3.0.4.tar.gz
+2df0b105bf0662f116de2ecbe0c0a107  audacious-plugins-3.2.tar.bz2



More information about the rpmfusion-commits mailing list