gnunet-svn
[Top][All Lists]
Advanced

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

[libextractor] branch master updated: adjust build process to largely wo


From: gnunet
Subject: [libextractor] branch master updated: adjust build process to largely work with libswresample (Debian #971331); alas, code is not yet working, commenting out opus plugin
Date: Mon, 01 Mar 2021 21:30:30 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libextractor.

The following commit(s) were added to refs/heads/master by this push:
     new 1e64237  adjust build process to largely work with libswresample 
(Debian #971331); alas, code is not yet working, commenting out opus plugin
1e64237 is described below

commit 1e64237ffae3c73efd864dc03ee2e3dfed29c10b
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Mar 1 21:29:07 2021 +0100

    adjust build process to largely work with libswresample (Debian #971331); 
alas, code is not yet working, commenting out opus plugin
---
 configure.ac                        |  15 +----
 po/da.po                            |   4 +-
 po/de.po                            |   4 +-
 po/es.po                            |   4 +-
 po/fr.po                            |   4 +-
 po/ga.po                            |   4 +-
 po/it.po                            |   4 +-
 po/libextractor.pot                 |   4 +-
 po/nl.po                            |   4 +-
 po/pl.po                            |   4 +-
 po/pt_BR.po                         |   4 +-
 po/ro.po                            |   4 +-
 po/rw.po                            |   4 +-
 po/sr.po                            |   4 +-
 po/sv.po                            |   4 +-
 po/uk.po                            |   4 +-
 po/vi.po                            |   4 +-
 src/plugins/Makefile.am             |   7 +--
 src/plugins/previewopus_extractor.c | 108 ++++++++++++++++++++++--------------
 19 files changed, 104 insertions(+), 90 deletions(-)

diff --git a/configure.ac b/configure.ac
index 456287a..8005a39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -667,17 +667,11 @@ AS_IF([test x$ffmpeg_enabled = x1],
  [ffmpeg_enabled=0
   new_ffmpeg=0
   AC_CHECK_HEADERS([libavutil/avutil.h libavformat/avformat.h 
libavcodec/avcodec.h libavutil/frame.h],
-    AC_CHECK_HEADERS([libavresample/avresample.h],
+    AC_CHECK_HEADERS([libswresample/swresample.h],
       AC_CHECK_LIB(avutil, av_audio_fifo_alloc,
-        new_ffmpeg=1)))
-
-  AC_CHECK_LIB(swscale, sws_getContext,
-    AC_CHECK_LIB(avcodec, avcodec_alloc_context3,
-      ffmpeg_enabled=1))
-  AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h 
ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h 
ffmpeg/swscale.h])
+        ffmpeg_enabled=1)))
  ])
 AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0)
-AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0)
 
 
 LE_INTLINCL=""
@@ -776,10 +770,7 @@ AS_IF([test "x$have_gsf" != "xtrue"],
   [AC_MSG_NOTICE([NOTICE: libgsf not found, no OLE2 (MS Office) support])])
 
 AS_IF([test "x$ffmpeg_enabled" = "x0"],
-  [AC_MSG_NOTICE([NOTICE: FFmpeg thumbnailer plugin disabled])])
-
-AS_IF([test "x$new_ffmpeg" = "x0"],
-  [AC_MSG_NOTICE([NOTICE: FFmpeg/opus audio preview plugin disabled, It needs 
libav >= 10, or a FFmpeg with --enable-libavresample])])
+  [AC_MSG_NOTICE([NOTICE: FFmpeg/opus audito thumbnailer plugin disabled])])
 
 AS_IF([test "x$have_gdk_pixbuf" = "x0"],
   [AC_MSG_NOTICE([NOTICE: libgdk-pixbuf not found, gtk thumbnail support 
disabled])])
diff --git a/po/da.po b/po/da.po
index 4be0e70..e8908a5 100644
--- a/po/da.po
+++ b/po/da.po
@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor-1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-02-14 16:38+0100\n"
 "Last-Translator: Joe Hansen <joedalton2@yahoo.dk>\n"
 "Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
@@ -140,7 +140,7 @@ msgstr "% BiBTeX-fil\n"
 msgid "Keywords for file %s:\n"
 msgstr "Nøgleord for filen %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Opstart af udvidelsesmodulmekanisme mislykkedes: %s!\n"
diff --git a/po/de.po b/po/de.po
index 0d3956e..91a21d8 100644
--- a/po/de.po
+++ b/po/de.po
@@ -10,7 +10,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-02-15 13:41+0100\n"
 "Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\n"
 "Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@@ -150,7 +150,7 @@ msgstr "% BibTeX-Datei\n"
 msgid "Keywords for file %s:\n"
 msgstr "Schlüsserwörter für die Datei %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Initialisierung des Plugin-Mechanismus ist fehlgeschlagen: %s.\n"
diff --git a/po/es.po b/po/es.po
index 83dd26b..b7290e3 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.0.0-pre1\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2018-04-27 22:53+0200\n"
 "Last-Translator: Francisco Javier Serrador <fserrador@gmail.com>\n"
 "Language-Team: Spanish <es@tp.org.es>\n"
@@ -142,7 +142,7 @@ msgstr "Fichero %% BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Palabras claves para fichero %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "¡Inicialización de mecanismo complementario fallado: %s!\n"
diff --git a/po/fr.po b/po/fr.po
index d59f170..a0fc6d7 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-05-12 04:34+0200\n"
 "Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
 "Language-Team: French <traduc@traduc.org>\n"
@@ -146,7 +146,7 @@ msgstr "% fichier BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Mots-clés pour le fichier %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Echec de l’initialisation du module %s !\n"
diff --git a/po/ga.po b/po/ga.po
index b45addf..7d18901 100644
--- a/po/ga.po
+++ b/po/ga.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 0.5.20\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2008-03-21 20:46-0700\n"
 "Last-Translator: Kevin Scannell <kscanne@gmail.com>\n"
 "Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
@@ -139,7 +139,7 @@ msgstr "%% Comhad BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Lorgfhocail do chomhad %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Theip ar th�s� meicn�ocht na mbreise�n: %s!\n"
diff --git a/po/it.po b/po/it.po
index ad3fe35..472cfb4 100644
--- a/po/it.po
+++ b/po/it.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor-0.6.0\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2010-09-30 23:41+0200\n"
 "Last-Translator: Sergio Zanchetta <primes2h@ubuntu.com>\n"
 "Language-Team: Italian <tp@lists.linux.it>\n"
@@ -136,7 +136,7 @@ msgstr "%% file BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr ""
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr ""
diff --git a/po/libextractor.pot b/po/libextractor.pot
index 346bafa..bdffbe2 100644
--- a/po/libextractor.pot
+++ b/po/libextractor.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -131,7 +131,7 @@ msgstr ""
 msgid "Keywords for file %s:\n"
 msgstr ""
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr ""
diff --git a/po/nl.po b/po/nl.po
index 328fc19..9bada5e 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor-1.0.0-pre1\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2013-08-21 22:41+0200\n"
 "Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
 "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
@@ -143,7 +143,7 @@ msgstr "%% BiBTeX-bestand\n"
 msgid "Keywords for file %s:\n"
 msgstr "Trefwoorden voor bestand %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Initialisatie van plugin-mechanisme is mislukt: %s\n"
diff --git a/po/pl.po b/po/pl.po
index a532b3e..a3ecbb3 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-02-12 16:02+0100\n"
 "Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
 "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@@ -138,7 +138,7 @@ msgstr "% plik BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Słowa kluczowe dla pliku %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Inicjalizacja mechanizmu wtyczek nie powiodła się: %s!\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index e20d192..29ca0a9 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-02-21 20:46-0200\n"
 "Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
 "Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
@@ -144,7 +144,7 @@ msgstr "% arquivo BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Palavras-chave para o arquivo %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Inicialização do mecanismo do plug-in falhou: %s!\n"
diff --git a/po/ro.po b/po/ro.po
index b61822a..56485aa 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 0.5.3\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2005-08-16 12:00-0500\n"
 "Last-Translator: Laurentiu Buzdugan <lbuz@rolix.org>\n"
 "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
@@ -142,7 +142,7 @@ msgstr "%% BiBTeX file\n"
 msgid "Keywords for file %s:\n"
 msgstr "Cuvinte cheie pentru fi�ier %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "ini�ializare mecanismului de plugin a e�uat: %s!\n"
diff --git a/po/rw.po b/po/rw.po
index 180d7ef..e9d27c3 100644
--- a/po/rw.po
+++ b/po/rw.po
@@ -16,7 +16,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 0.4.2\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2005-04-04 10:55-0700\n"
 "Last-Translator: Steven Michael Murphy <murf@e-tools.com>\n"
 "Language-Team: Kinyarwanda <translation-team-rw@lists.sourceforge.net>\n"
@@ -149,7 +149,7 @@ msgstr ""
 msgid "Keywords for file %s:\n"
 msgstr "kugirango IDOSIYE"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, fuzzy, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Bya Byanze"
diff --git a/po/sr.po b/po/sr.po
index 71b80c1..c5248fb 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor-1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2020-04-02 08:30+0200\n"
 "Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
 "Language-Team: Serbian <(nothing)>\n"
@@ -140,7 +140,7 @@ msgstr "% БиБТеКс датотека\n"
 msgid "Keywords for file %s:\n"
 msgstr "Кључне речи за датотеку „%s“:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Покретање механизма прикључка није успело: %s!\n"
diff --git a/po/sv.po b/po/sv.po
index 707f649..1c14b05 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 0.5.22\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2009-05-12 17:45+0100\n"
 "Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -136,7 +136,7 @@ msgstr "%% BiBTeX-fil\n"
 msgid "Keywords for file %s:\n"
 msgstr "Nyckelord för filen %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Initiering av insticksmekanism misslyckades: %s!\n"
diff --git a/po/uk.po b/po/uk.po
index 85244bb..464cf92 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 1.9\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2019-02-10 20:41+0200\n"
 "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
 "Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n"
@@ -151,7 +151,7 @@ msgstr "% файл BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Ключові слова для файла %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Помилка під час спроби ініціалізації механізму додатків: %s!\n"
diff --git a/po/vi.po b/po/vi.po
index 47b8770..e85941c 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: libextractor 0.6.0\n"
 "Report-Msgid-Bugs-To: libextractor@gnu.org\n"
-"POT-Creation-Date: 2020-07-02 15:57+0200\n"
+"POT-Creation-Date: 2021-01-30 15:28+0100\n"
 "PO-Revision-Date: 2010-02-11 00:13+0930\n"
 "Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
 "Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@@ -145,7 +145,7 @@ msgstr "%% tập tin BiBTeX\n"
 msgid "Keywords for file %s:\n"
 msgstr "Từ khoá cho tập tin %s:\n"
 
-#: src/main/extractor.c:680
+#: src/main/extractor.c:679
 #, c-format
 msgid "Initialization of plugin mechanism failed: %s!\n"
 msgstr "Việc khởi động cơ chế cầm phít bị lỗi: %s\n"
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 8cdd905..37e31e5 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -69,14 +69,11 @@ PLUGIN_MIME=libextractor_mime.la
 TEST_MIME=test_mime
 
 if HAVE_FFMPEG
-# FFmpeg-thumbnailer requires MAGIC and FFMPEG
 PLUGIN_FFMPEG=libextractor_thumbnailffmpeg.la
 TEST_FFMPEG=test_thumbnailffmpeg
-endif
 
-if HAVE_FFMPEG_NEW
-PLUGIN_PREVIEWOPUS=libextractor_previewopus.la
-TEST_PREVIEWOPUS=test_previewopus
+#PLUGIN_PREVIEWOPUS=libextractor_previewopus.la
+#TEST_PREVIEWOPUS=test_previewopus
 endif
 
 if HAVE_GDK_PIXBUF
diff --git a/src/plugins/previewopus_extractor.c 
b/src/plugins/previewopus_extractor.c
index 45ea420..f137f38 100644
--- a/src/plugins/previewopus_extractor.c
+++ b/src/plugins/previewopus_extractor.c
@@ -44,7 +44,7 @@
 #include <libavformat/avformat.h>
 #include <libavcodec/avcodec.h>
 #include <libswscale/swscale.h>
-#include <libavresample/avresample.h>
+#include <libswresample/swresample.h>
 
 
 /**
@@ -300,7 +300,7 @@ init_input_frame (AVFrame **frame)
 static int
 init_resampler (AVCodecContext *input_codec_context,
                 AVCodecContext *output_codec_context,
-                AVAudioResampleContext  **resample_context)
+                SwrContext  **resample_context)
 {
   /**
    * Only initialize the resampler if it is necessary, i.e.,
@@ -312,7 +312,7 @@ init_resampler (AVCodecContext *input_codec_context,
     int error;
 
     /** Create a resampler context for the conversion. */
-    if (! (*resample_context = avresample_alloc_context ()))
+    if (! (*resample_context = swr_alloc ()))
     {
 #if DEBUG
       fprintf (stderr, "Could not allocate resample context\n");
@@ -326,28 +326,35 @@ init_resampler (AVCodecContext *input_codec_context,
      * Default channel layouts based on the number of channels
      * are assumed for simplicity (they are sometimes not detected
      * properly by the demuxer and/or decoder).
-     */av_opt_set_int (*resample_context, "in_channel_layout",
+     */
+    av_opt_set_int (*resample_context,
+                    "in_channel_layout",
                     av_get_default_channel_layout (
                       input_codec_context->channels), 0);
-    av_opt_set_int (*resample_context, "out_channel_layout",
+    av_opt_set_int (*resample_context,
+                    "out_channel_layout",
                     av_get_default_channel_layout (
                       output_codec_context->channels), 0);
-    av_opt_set_int (*resample_context, "in_sample_rate",
+    av_opt_set_int (*resample_context,
+                    "in_sample_rate",
                     input_codec_context->sample_rate, 0);
-    av_opt_set_int (*resample_context, "out_sample_rate",
+    av_opt_set_int (*resample_context,
+                    "out_sample_rate",
                     output_codec_context->sample_rate, 0);
-    av_opt_set_int (*resample_context, "in_sample_fmt",
+    av_opt_set_int (*resample_context,
+                    "in_sample_fmt",
                     input_codec_context->sample_fmt, 0);
-    av_opt_set_int (*resample_context, "out_sample_fmt",
+    av_opt_set_int (*resample_context,
+                    "out_sample_fmt",
                     output_codec_context->sample_fmt, 0);
 
     /** Open the resampler with the specified parameters. */
-    if ((error = avresample_open (*resample_context)) < 0)
+    if ((error = swr_init (*resample_context)) < 0)
     {
 #if DEBUG
       fprintf (stderr, "Could not open resample context\n");
 #endif
-      avresample_free (resample_context);
+      swr_free (resample_context);
       return error;
     }
   }
@@ -461,7 +468,8 @@ decode_audio_frame (AVFrame *frame,
  * The number of audio samples to be allocated is specified in frame_size.
  */
 static int
-init_converted_samples (uint8_t ***converted_input_samples, int*out_linesize,
+init_converted_samples (uint8_t ***converted_input_samples,
+                        int*out_linesize,
                         AVCodecContext *output_codec_context,
                         int frame_size)
 {
@@ -484,7 +492,8 @@ init_converted_samples (uint8_t ***converted_input_samples, 
int*out_linesize,
    * Allocate memory for the samples of all channels in one consecutive
    * block for convenience.
    */
-  if ((error = av_samples_alloc (*converted_input_samples, out_linesize,
+  if ((error = av_samples_alloc (*converted_input_samples,
+                                 out_linesize,
                                  output_codec_context->channels,
                                  frame_size,
                                  output_codec_context->sample_fmt, 0)) < 0)
@@ -509,19 +518,26 @@ init_converted_samples (uint8_t 
***converted_input_samples, int*out_linesize,
  */
 static int
 convert_samples (uint8_t **input_data,
-                 uint8_t **converted_data, const int in_sample, const int
-                 out_sample, const int out_linesize,
-                 AVAudioResampleContext  *resample_context)
+                 uint8_t **converted_data,
+                 int in_sample,
+                 int out_sample,
+                 int out_linesize,
+                 SwrContext  *resample_context)
 {
   int error;
 
   /** Convert the samples using the resampler. */
-  if ((error = avresample_convert (resample_context, converted_data,
-                                   out_linesize,
-                                   out_sample, input_data, 0, in_sample)) < 0)
+  if ((error = swr_convert (resample_context,
+                            converted_data,
+                            out_linesize,
+                            out_sample,
+                            input_data,
+                            0,
+                            in_sample)) < 0)
   {
 #if DEBUG
-    fprintf (stderr, "Could not convert input samples (error '%s')\n",
+    fprintf (stderr,
+             "Could not convert input samples (error '%s')\n",
              get_error_text (error));
 #endif
     return error;
@@ -532,11 +548,13 @@ convert_samples (uint8_t **input_data,
    * Perform a sanity check so that the number of converted samples is
    * not greater than the number of samples to be converted.
    * If the sample rates differ, this case has to be handled differently
-   */if (avresample_available (resample_context))
+   */
+  if (avresample_available (resample_context))
   {
 #if DEBUG
-    fprintf (stderr, "%i Converted samples left over\n",avresample_available (
-               resample_context));
+    fprintf (stderr,
+             "%i Converted samples left over\n",
+             avresample_available (resample_context));
 #endif
   }
 
@@ -588,7 +606,7 @@ read_decode_convert_and_store (AVAudioFifo *fifo,
                                AVFormatContext *input_format_context,
                                AVCodecContext *input_codec_context,
                                AVCodecContext *output_codec_context,
-                               AVAudioResampleContext  *resampler_context, int
+                               SwrContext  *resampler_context, int
                                audio_stream_index,
                                int *finished)
 {
@@ -609,22 +627,25 @@ read_decode_convert_and_store (AVAudioFifo *fifo,
 
   }
   /** Decode one frame worth of audio samples. */
-  if (decode_audio_frame (input_frame, input_format_context,
-                          input_codec_context, audio_stream_index,
-                          &data_present,  finished))
+  if (decode_audio_frame (input_frame,
+                          input_format_context,
+                          input_codec_context,
+                          audio_stream_index,
+                          &data_present,
+                          finished))
   {
 #if DEBUG
     fprintf (stderr, "Failed at decode audio\n");
 #endif
 
     goto cleanup;
-
   }
   /**
    * If we are at the end of the file and there are no more samples
    * in the decoder which are delayed, we are actually finished.
    * This must not be treated as an error.
-   */if (*finished && ! data_present)
+   */
+  if (*finished && ! data_present)
   {
     ret = 0;
 #if DEBUG
@@ -636,7 +657,7 @@ read_decode_convert_and_store (AVAudioFifo *fifo,
   if (data_present)
   {
     int out_linesize;
-    // FIX ME: I'm losing samples, but can't get it to work.
+    // FIXME: I'm losing samples, but can't get it to work.
     int out_samples = avresample_available (resampler_context)
                       + avresample_get_delay (resampler_context)
                       + input_frame->nb_samples;
@@ -645,7 +666,8 @@ read_decode_convert_and_store (AVAudioFifo *fifo,
     // fprintf(stderr, "Input nbsamples %i out_samples: %i 
\n",input_frame->nb_samples,out_samples);
 
     /** Initialize the temporary storage for the converted input samples. */
-    if (init_converted_samples (&converted_input_samples, &out_linesize,
+    if (init_converted_samples (&converted_input_samples,
+                                &out_linesize,
                                 output_codec_context,
                                 out_samples))
     {
@@ -659,20 +681,23 @@ read_decode_convert_and_store (AVAudioFifo *fifo,
      * Convert the input samples to the desired output sample format.
      * This requires a temporary storage provided by converted_input_samples.
      */
-    if (convert_samples (input_frame->extended_data, converted_input_samples,
-                         input_frame->nb_samples, out_samples, out_linesize,
+    if (convert_samples (input_frame->extended_data,
+                         converted_input_samples,
+                         input_frame->nb_samples,
+                         out_samples,
+                         out_linesize,
                          resampler_context))
     {
-
-
 #if DEBUG
-      fprintf (stderr, "Failed at convert_samples, input frame %i \n",
+      fprintf (stderr,
+               "Failed at convert_samples, input frame %i \n",
                input_frame->nb_samples);
 #endif
       goto cleanup;
     }
     /** Add the converted input samples to the FIFO buffer for later 
processing. */
-    if (add_samples_to_fifo (fifo, converted_input_samples,
+    if (add_samples_to_fifo (fifo,
+                             converted_input_samples,
                              out_samples))
     {
 #if DEBUG
@@ -881,7 +906,7 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec)
   AVDictionary *options;
   AVFrame *frame;
   AVCodecContext*output_codec_context = NULL;
-  AVAudioResampleContext  *resample_context = NULL;
+  SwrContext  *resample_context = NULL;
   AVAudioFifo *fifo = NULL;
 
   int audio_stream_index;
@@ -1045,7 +1070,8 @@ extract_audio (struct EXTRACTOR_ExtractContext *ec)
      * Since the decoder's and the encoder's frame size may differ, we
      * need to FIFO buffer to store as many frames worth of input samples
      * that they make up at least one frame worth of output samples.
-     */while ((av_audio_fifo_size (fifo) < output_frame_size))
+     */
+    while ((av_audio_fifo_size (fifo) < output_frame_size))
     {
       /**
        * Decode one frame worth of audio samples, convert it to the
@@ -1143,8 +1169,8 @@ cleanup:
     av_audio_fifo_free (fifo);
   if (resample_context)
   {
-    avresample_close (resample_context);
-    avresample_free (&resample_context);
+    swr_close (resample_context);
+    swr_free (&resample_context);
   }
   if (output_codec_context)
     avcodec_close (output_codec_context);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]