debian/0000775000000000000000000000000012344165451007175 5ustar debian/rules0000775000000000000000000000155012344156755010265 0ustar #!/usr/bin/make -f export DEB_LDFLAGS_MAINT_APPEND=-Wl,-z,defs -Wl,--as-needed configure_flags := \ --disable-dynamic-loading \ --with-expat=system \ --with-ffmpeg=system \ --with-lame=system \ --with-libflac=system \ --with-libid3tag=system \ --with-libmad=system \ --without-libresample \ --without-libsamplerate \ --with-libsndfile=system \ --with-libsoxr=system \ --with-libtwolame=system \ --with-libvamp=system \ --with-libvorbis=system \ --with-midi=system \ --with-portaudio=system \ --with-sbsms=system \ --with-soundtouch=system \ $(NULL) %: dh $@ --parallel --with autoreconf override_dh_auto_configure: dh_auto_configure -- $(configure_flags) override_dh_auto_install: dh_auto_install # Don't package unnecessary copy of GPL rm debian/tmp/usr/share/doc/audacity/LICENSE.txt override_dh_strip: dh_strip --dbg-package=audacity-dbg debian/audacity.install0000664000000000000000000000026612344156711012373 0ustar debian/source_audacity.py usr/share/apport/package-hooks usr/bin usr/share/applications usr/share/doc usr/share/man usr/share/pixmaps/audacity16.xpm usr/share/pixmaps/audacity32.xpm debian/control0000664000000000000000000000617012344156711010603 0ustar Source: audacity Section: sound Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Multimedia Maintainers Uploaders: Free Ekanayaka , Benjamin Drung , David Henningsson Standards-Version: 3.9.4 Build-Depends: autoconf, automake, debhelper (>= 9), dh-autoreconf, gettext, libasound2-dev [linux-any], libavcodec-dev (>= 6:0.8), libavformat-dev (>= 6:0.8), libavutil-dev (>= 6:0.8), libexpat1-dev, libflac++-dev, libgtk2.0-dev, libid3tag0-dev, libjack-dev, libmad0-dev (>= 0.14.2b), libmp3lame-dev, libogg-dev (>= 1.0.0), libportsmf-dev, libsbsms-dev (>= 2.0.0), libsndfile1-dev (>= 1.0.0), libsoundtouch-dev (>= 1.3.1-2), libsoxr-dev (>= 0.0.5), libtwolame-dev (>= 0.3.9), libvorbis-dev (>= 1.0.0-3), libwxgtk2.8-dev, portaudio19-dev (>= 19+svn20101113-3~), vamp-plugin-sdk (>= 2.0) Build-Conflicts: libwxbase2.6-dev, wx2.6-headers Homepage: http://audacity.sourceforge.net/ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-multimedia/audacity.git Vcs-Git: git://anonscm.debian.org/pkg-multimedia/audacity.git Package: audacity Architecture: any Depends: audacity-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} Suggests: ladspa-plugin Description: fast, cross-platform audio editor Audacity is a multi-track audio editor for Linux/Unix, MacOS and Windows. It is designed for easy recording, playing and editing of digital audio. Audacity features digital effects and spectrum analysis tools. Editing is very fast and provides unlimited undo/redo. . Supported file formats include Ogg Vorbis, MP2, MP3, WAV, AIFF, and AU. Package: audacity-data Architecture: all Depends: ${misc:Depends} Recommends: audacity Breaks: audacity (<= 1.3.6-2) Replaces: audacity (<= 1.3.6-2) Description: fast, cross-platform audio editor (data) Audacity is a multi-track audio editor for Linux/Unix, MacOS and Windows. It is designed for easy recording, playing and editing of digital audio. Audacity features digital effects and spectrum analysis tools. Editing is very fast and provides unlimited undo/redo. . This package contains the architecture-independent data files. Package: audacity-dbg Section: debug Priority: extra Architecture: any Depends: audacity (= ${binary:Version}), ${misc:Depends} Description: fast, cross-platform audio editor (debug) Audacity is a multi-track audio editor for Linux/Unix, MacOS and Windows. It is designed for easy recording, playing and editing of digital audio. Audacity features digital effects and spectrum analysis tools. Editing is very fast and provides unlimited undo/redo. . This package contains the debugging symbols. debian/NEWS0000664000000000000000000000044512231441137007670 0ustar audacity (1.3.6-3) unstable; urgency=low Explicitly built against the system libsamplerate, effectively disabling the internal libresample. This may break support for proprietary VST plug-ins! -- Fabian Greffrath Tue, 20 Jan 2009 09:15:11 +0100 debian/changelog0000664000000000000000000011263112344165442011053 0ustar audacity (2.0.5-1ubuntu3.2) trusty-proposed; urgency=medium * Really enable FFmpeg and fix crash on FFmpeg import (LP: #1076928) -- Benjamin Drung Thu, 05 Jun 2014 23:16:16 +0200 audacity (2.0.5-1ubuntu3.1) trusty-proposed; urgency=medium * Add support for recent FFmpeg/libav versions. Thanks to Michael Niedermayer for the porting work. (Closes: #740755, LP: #1076928) * Fix default LADSPA search paths on Linux. (Closes: #724836, LP: #1261654) -- Benjamin Drung Sat, 31 May 2014 22:18:25 +0200 audacity (2.0.5-1ubuntu3) trusty; urgency=low * Disable libav support... Ubuntu now ships libav 9. -- Dmitrijs Ledkovs Sun, 10 Nov 2013 20:30:26 +0000 audacity (2.0.5-1ubuntu2) trusty; urgency=low * No change rebuild against libav 9. -- Dmitrijs Ledkovs Tue, 05 Nov 2013 01:19:47 +0000 audacity (2.0.5-1ubuntu1) trusty; urgency=low * Enable libav support again. Ubuntu does not ship libav 9 yet. -- Benjamin Drung Tue, 22 Oct 2013 13:26:47 +0200 audacity (2.0.5-1) unstable; urgency=low * New upstream release. * Add distclean.patch to make dh_auto_clean work again. -- Benjamin Drung Tue, 22 Oct 2013 12:53:52 +0200 audacity (2.0.4-1) unstable; urgency=low * Team upload. [ Petr Vorel ] * debian/watch: Check for xz compressed tarballs. (Closes: #722133) [ Sebastian Ramacher ] * New upstream release. * debian/patches/bp-docdir-fix.patch: Removed (applied upstream). * Disable libav support. (Closes: #692809) audacity is not yet compatible with libav 9 and needs to be ported first. Until audacity has been ported, support for some audio formats (AC3, M4A, MP4, WMA) is not available. - debian/control: Remove libav{codec,format,util}-dev build dependencies. - debian/rules: Build with --without-ffmpeg. * Use dh-autoreconf to clean up generated auto* files. * Bump debhelper compat to 9. - Decreases the Installed-Size of audacity-dbg by a large amount since dh_strip now uses compressed debugging symbol files. - {C,CXX,LD,CPP}FLAGS are automatically exported. - Bump debhelper build dependency to >= 9. We at least need 8.1 to support Standards-Version 3.9.4 (binary-{arch,indep} targets). * debian/rules: Override dh_auto_clean since it gets confused by the output of 'make clean' and 'make distclean' and does not detect that the targets are available. * debian/control: Remove useless zip build-dependency. -- Sebastian Ramacher Sat, 14 Sep 2013 18:19:36 +0200 audacity (2.0.3-1) unstable; urgency=low * New upstream release (LP: #1107520). - Add keyboard shortcut for export (LP: #651499) * Drop disable-dynamic-ffmpeg.patch (accepted upstream). * Replace libsamplerate by libsoxr, which is faster and produces better resampling results. * Bump Standard-Version to 3.9.4 (no changes needed). * Use canonical URI for VCS-* fields. * Fix docdir path. -- Benjamin Drung Sat, 06 Apr 2013 14:28:29 +0200 audacity (2.0.2-1) unstable; urgency=low * New upstream release. * Drop additional-mime-types.patch (accepted upstream). * Refresh disable-dynamic-ffmpeg.patch. -- Benjamin Drung Fri, 24 Aug 2012 11:39:19 +0200 audacity (2.0.1-1) unstable; urgency=low * New upstream release. * Update patches. -- Benjamin Drung Sat, 30 Jun 2012 00:45:22 +0200 audacity (2.0.1~rc2-1) unstable; urgency=low * New upstream release. * Drop four patches that were applied upstream. * Refresh remaining patches. -- Benjamin Drung Wed, 27 Jun 2012 12:44:13 +0200 audacity (2.0.1~rc1-2) unstable; urgency=low * Allow opening files with Audacity with your file manager. (LP: #1006610) -- Benjamin Drung Mon, 25 Jun 2012 02:06:15 +0200 audacity (2.0.1~rc1-1) unstable; urgency=low * New upstream release. * Build against system libsbsms. * Refresh patches. -- Benjamin Drung Sat, 23 Jun 2012 23:50:34 +0200 audacity (2.0.0-1) unstable; urgency=low * New upstream release. * Drop fix-glib-include-error.patch (fixed upstream). * Use build flags from the environment for portmixer. Thanks to Simon Ruderich (Closes: #663275) -- Benjamin Drung Wed, 14 Mar 2012 14:43:28 +0100 audacity (2.0.0~rc8-1) unstable; urgency=low * New upstream release. * Enable hardened build flags through dpkg-buildflags. * debian/watch: Show 1000 entries instead of only 100. * Register FLAC file type in .desktop file. (Closes: #661921) * Fix build failure with Glib 2.31.20. -- Benjamin Drung Thu, 08 Mar 2012 17:10:05 +0100 audacity (2.0.0~rc6-1) unstable; urgency=low * New upstream release. * Bump Standards-Version to 3.9.3, no changes needed. -- Benjamin Drung Wed, 29 Feb 2012 01:26:22 +0100 audacity (2.0.0~rc4-1) unstable; urgency=low * New upstream release. -- Benjamin Drung Thu, 23 Feb 2012 15:58:54 +0100 audacity (2.0.0~rc1-1) unstable; urgency=low * New upstream release. * Update debian/watch file. * Drop FFmpeg/libav patches (they were accepted upstream). * Improve label-region-relation.patch. -- Benjamin Drung Sat, 18 Feb 2012 12:55:34 +0100 audacity (1.3.14-3) unstable; urgency=low * Change the behavior of point labels to behave like region labels. -- Benjamin Drung Fri, 20 Jan 2012 18:12:51 +0100 audacity (1.3.14-2) unstable; urgency=low * Add missing include to support building Audacity with libav 0.8. (Closes: #654212) -- Benjamin Drung Sat, 14 Jan 2012 13:49:00 +0100 audacity (1.3.14-1) unstable; urgency=low * New upstream release (Closes: #651949). * Drop backported patches and refresh remaining patches. * Replace libav-0.7.patch by ffmpeg-2.patch from upstream. -- Benjamin Drung Thu, 22 Dec 2011 23:35:29 +0100 audacity (1.3.13-5) unstable; urgency=low * Use linux-any instead of hardcoded list of non-Linux architectures. (Closes: #634303) * Build against libmp3lame. (Closes: #600747) -- Benjamin Drung Fri, 29 Jul 2011 18:06:22 +0200 audacity (1.3.13-4) unstable; urgency=low * libav-0.7.patch: Unbreak compilation against libav 0.7. Thanks to Reinhard Tartler for the patch (Closes: #628201) * Bump required libav version to 0.6 (Closes: #628138) -- Benjamin Drung Sat, 28 May 2011 13:41:09 +0200 audacity (1.3.13-3) unstable; urgency=low * Apply followup commits for fixing upstream bug #367. * Apply upstream fix for upstream bug #137. -- Benjamin Drung Sat, 23 Apr 2011 11:43:42 +0200 audacity (1.3.13-2) unstable; urgency=low * Apply two upstream fixes for the upstream bugs #350 and #367. -- Benjamin Drung Sun, 17 Apr 2011 18:43:04 +0200 audacity (1.3.13-1) unstable; urgency=low * New upstream release (LP: #608948, #690226, #694778, #713584, #753323). * Drop 13 upstream applied patches. * Refresh disable dynamic loading patches. * Drop configure.patch and run ./autogen.sh on build time instead. * Use local sbsms due to an API change. -- Benjamin Drung Wed, 13 Apr 2011 01:43:29 +0200 audacity (1.3.12-17) unstable; urgency=low * Drop article from the description synopsis. * Add Applied-Upstream tag to patches. * Build against portSMF. * Build against libsbsms. * Bump Standards-Version to 3.9.2 (no changes required). -- Benjamin Drung Sat, 09 Apr 2011 18:25:32 +0200 audacity (1.3.12-16) unstable; urgency=low * Split and update disable-dynamic-loading.patch. * Add support to disable dynamic loading of LAME. -- Benjamin Drung Fri, 11 Mar 2011 17:10:04 +0100 audacity (1.3.12-15) unstable; urgency=low * Fix crash on WMA export (LP: #695648). -- Benjamin Drung Wed, 09 Mar 2011 12:09:51 +0100 audacity (1.3.12-14) unstable; urgency=low [ Fabian Greffrath ] * Remove myself from Uploaders. [ Benjamin Drung ] * Soundtouch >= 1.5 uses soundtouch.pc and not soundtouch-1.4.pc -- Benjamin Drung Mon, 28 Feb 2011 15:04:39 +0100 audacity (1.3.12-13) unstable; urgency=low * Compile against system portAudio (Closes: #323711). -- Benjamin Drung Sat, 26 Feb 2011 23:02:54 +0100 audacity (1.3.12-12) unstable; urgency=low * Rebuild against the newest soundtouch. -- Benjamin Drung Sat, 19 Feb 2011 15:06:35 +0100 audacity (1.3.12-11) unstable; urgency=low * Tighten build dependencies. * Add portsmf-configure.patch to support using system portSMF. * Fix char to const char conversion in src/TrackArtist.cpp. -- Benjamin Drung Thu, 17 Feb 2011 21:08:58 +0100 audacity (1.3.12-9) unstable; urgency=low * Drop ffmpeg-av-match-ext.patch in favor of disable-dynamic-loading.patch. * Update my email address. * Drop DM-Upload-Allowed from debian/control. -- Benjamin Drung Thu, 06 Jan 2011 22:04:37 +0100 audacity (1.3.12-8) experimental; urgency=low * Pick up upstream improvements to the slider background color patch. -- Benjamin Drung Thu, 25 Nov 2010 23:02:25 +0100 audacity (1.3.12-7) experimental; urgency=low * Fix interchanged bug numbers from previous upload. * Support FFmpeg >= 0.6 (Closes: #593162, LP: #602934). -- Benjamin Drung Wed, 22 Sep 2010 02:37:52 +0200 audacity (1.3.12-6) unstable; urgency=low * Build with jack on all architectures (Due to a bug, jack was already enabled on all architectures except on i386, amd64, powerpc). * Fix build failure with GCC 4.5 (Closes: #564865, LP: #629955). -- Benjamin Drung Tue, 21 Sep 2010 22:47:19 +0200 audacity (1.3.12-5) unstable; urgency=low * Fix missing content in debug package. * Bump Standards-Version to 3.9.1 (no changes required). -- Benjamin Drung Thu, 05 Aug 2010 12:53:38 +0200 audacity (1.3.12-4) unstable; urgency=low [ Fabian Greffrath ] * Fix debian/watch to consult sourceforge again, as googlecode changed their download page link format. * Update my e-mail address. [ Benjamin Drung ] * Switch from CDBS to dh 7. * Convert versioned Conflicts into Breaks. * Simplify debian/rules. * Bump Standards-Version to 3.9.0 (no changes required). * Add open-mixer.patch to fix segfault with multiple ALSA devices. (Closes: #584605) - thanks to Dave Witbrodt -- Benjamin Drung Wed, 30 Jun 2010 01:09:55 +0200 audacity (1.3.12-3) unstable; urgency=high * Do not install audacity.xpm (Closes: #578509). -- Benjamin Drung Mon, 26 Apr 2010 01:20:30 +0200 audacity (1.3.12-2) unstable; urgency=low * Add fix-slider-background-color.patch to fix background color of sliders. -- Benjamin Drung Sun, 04 Apr 2010 17:54:47 +0200 audacity (1.3.12-1) unstable; urgency=low * New upstream release. * Remove all patches (they are applied upstream). * Remove all images from debian directory (they are now included in the upstrem tarball). * Update debian/*.install files. * Enable the feature to link audio tracks to a label track. * Update watch file. * Drop unused libtag1-dev from Build-Depends. -- Benjamin Drung Sat, 03 Apr 2010 01:43:27 +0200 audacity (1.3.11-2) unstable; urgency=low * Fix export by track bug in export-multiple.patch. * Update meta data of patches. * Bump Standards-Version to 3.8.4 (no changes required). * Add trailing blank line to debian/NEWS. -- Benjamin Drung Wed, 03 Feb 2010 14:02:14 +0100 audacity (1.3.11-1) unstable; urgency=low * New upstream release. - builds with binutils-gold (Closes: #553969) - builds with upcoming gcc 4.5 (gcc-snapshot 20100117-1) (Closes: #564865) - Click Track and other Nyquist plugins work on amd64 (LP: #454859) * Drop hurd.patch (accepted upstream). * Remove asterisk from debian/NEWS. -- Benjamin Drung Tue, 19 Jan 2010 23:42:22 +0100 audacity (1.3.10-2) unstable; urgency=low * Build against system libvamp and taglib. * Add hurd.patch to fix missing NOFILE on GNU/Hurd. -- Benjamin Drung Thu, 31 Dec 2009 01:16:47 +0100 audacity (1.3.10-1) unstable; urgency=low * New upstream release. * Drop patches, which are accepted or applied upstream: - closing-2nd-while-recording-in-1st.patch - crash-on-get-default-device.patch - ffmpeg-0.5-compatibility.diff - gsocket.patch - labeltrack-crash.patch - stopstream-on-close.patch * Refresh remaining patches. * Switch to new source format 3.0 (quilt). * debian/rules: Use autotools class instead of gnome class. * Bump debhelper version to 7. -- Benjamin Drung Wed, 02 Dec 2009 01:45:30 +0100 audacity (1.3.9-7) unstable; urgency=low [ David Henningsson ] * Avoid crash in GetDefaultPlayDevice (LP: #475277) * Fixed crash on start recording, then open and close a project window * Update my email address * Add apport hook for better bug reports on Ubuntu * stopstream-on-close.patch has now been forwarded and committed upstream. [ Benjamin Drung ] * Add Applied-Upstream meta data to patch. -- Benjamin Drung Sat, 28 Nov 2009 13:43:20 +0100 audacity (1.3.9-6) unstable; urgency=low [ David Henningsson ] * Add myself to uploaders * Avoid that Audacity leaves autosave files behind, if quitted with monitoring enabled (LP: #455990) * prevent crashes when undoing label track changes (picked from upstream CVS). (LP: #385538) -- Benjamin Drung Thu, 22 Oct 2009 00:22:42 +0200 audacity (1.3.9-5) unstable; urgency=low * Add debian/patches/disk-full-on-export.patch to show an error message if the disk gets full on PCM export; thanks to David Henningsson for the patch (LP: #259798). -- Benjamin Drung Sun, 11 Oct 2009 17:52:06 +0200 audacity (1.3.9-4) unstable; urgency=low * Add debian/patches/switch-hostapi-crash.patch to prevent crash when selecting sound card driver; thanks to David Henningsson for the patch (LP: #436990). -- Benjamin Drung Sat, 26 Sep 2009 15:58:39 +0200 audacity (1.3.9-3) unstable; urgency=low * Add debian/patches/gsocket.patch to fix conflicting GSocket definition. -- Benjamin Drung Fri, 11 Sep 2009 10:39:31 +0200 audacity (1.3.9-2) unstable; urgency=low * Respect locales/$LANG (Closes: #481424, LP: #292168). - Add debian/patches/lang.patch * Drop CVE-2007-6061.patch and remove notice from NEWS file. The security issue is fixed since version 1.3.5 and /tmp can be used as temporary directory again. * Remove resolved news item from experimental (Closes: #545402). -- Benjamin Drung Tue, 08 Sep 2009 17:05:00 +0200 audacity (1.3.9-1) unstable; urgency=low * New upstream release. * Drop 10-kFreeBSD.patch and 20-autoconf.patch (accepted by upstream). * Drop debian/patches/dont-create-help-directory-on-runtime.patch. * Add debian/patches/ffmpeg-0.5-compatibility.diff to make audacity compatible to the ffmpeg 0.5 series. * Rename recommended "unstripped" to "extra" ffmpeg variants. * Add meta-information to all patch files according to the DEP-3. * Do not link against unused libraries (make dpkg-shlibdeps happy). -- Benjamin Drung Tue, 01 Sep 2009 02:17:01 +0200 audacity (1.3.8-1) experimental; urgency=low [ Benjamin Drung ] * New upstream release. * Drop patches that are applied or adopted upstream: - curly-brace-before-preprocessor-endif.patch - desktop_file.patch - make-distclean.patch - pulseaudio.patch * Drop portaudio.patch, it does not apply anymore and audacity was never build against portaudio. * debian/NEWS: Fix typo (thanks to Lintian). * Bump Standards-Version to 3.8.3 (no changes). * Drop debian/source.lintian-overrides, not needed any longer. * Update debian/watch file to search on Google Code. * Do not create help directory on runtime (backport patch from upstream) - Add debian/patches/dont-create-help-directory-on-runtime.patch * Add debian/patches/export-multiple.patch (LP: #276043). * Add debian/patches/10-kFreeBSD.patch and debian/patches/20-autoconf.patch to fix FTBFS on GNU/kFreeBSD; thanks to Petr Salinger for the patch (Closes: #542765). * Allow uploads done by Debian Maintainers. * This release is not compatible to the ffmpeg 0.5 series. Left a notice in debian/NEWS. [ Reinhard Tartler ] * Build against system taglib -- Benjamin Drung Tue, 25 Aug 2009 03:28:39 +0200 audacity (1.3.7-3) unstable; urgency=low [ Fabian Greffrath ] * Remove Matt Brubeck from Uploaders (Closes: #521481). [ Reinhard Tartler ] * Recommend alternatively on the "unstripped" ffmpeg variants (LP: #344061). [ Benjamin Drung ] * debian/control: + Update my e-mail address. + Move audacity-dbg to section debug. * Bumped Standards-Version to 3.8.1. * Update make-distclean.patch to also remove lib-src/libportmixer.a. * Add debian/source.lintian-overrides to suppress ancient-libtool warning. * Add Audacity SVG icon; thanks to Aaron Spike (LP: #157828). -- Benjamin Drung Sun, 14 Jun 2009 23:17:41 +0200 audacity (1.3.7-2) unstable; urgency=low * Build against system FFmpeg for import and export support (Closes: #512278, #5143333). * Build-Depend on recent versions of the ffmpeg headers and recommend ffmpeg shared libraries with recent sonames to make sure the ffmpeg packages are new enough for audacity. * Recent ffmpeg packages have Speex support enabled, so audacity can also benefit from this feature (Closes: #329802). * Re-enable PortMixer, as recommended upstream: -- Fabian Greffrath Tue, 17 Feb 2009 10:27:17 +0100 audacity (1.3.7-1) experimental; urgency=low [ Benjamin Drung ] * New upstream release. + Fixes error on second build (Closes: #442497, #486155). * Dropped hyphen-used-as-minus-sign.patch (applied upstream). * Added curly-brace-before-preprocessor-endif.patch to fix compile error. * Added myself to Uploaders. * Added make-distclean.patch. * Updated watch file. * Removed Ubuntu changelog entries. [ Fabian Greffrath ] * Removed spurious "DEB_COMPRESS_EXCLUDE := *.htb" from debian/rules. There isn't even one file of this name in the packages. -- Benjamin Drung Wed, 04 Feb 2009 20:16:48 +0100 audacity (1.3.6-3) unstable; urgency=low * Added myself to Uploaders. * Wrapped Uploaders and Build-Depends fields. * Ordered and cleaned up Build-Depends, added autotools-dev. * Bumped Standards-Version to 3.8.0. * Moved Homepage from package description to Source stanza. * Added ${misc:Depends} to Depends. * Added MP2-support via libtwolame (Closes: #448762, #481338). * Removed obsolete audacity.dirs and blank lines in debian/audacity.install and debian/rules. * Use Applications/Sound in audacity.menu. * Use sf.net redirector in debian/watch. * Fixed syntax errors in architecture checks in debian/rules (Closes: #486147). * Removed redundant debhelper calls from debian/rules and force remove of the license file. * Added patch to fix hyphen-used-as-minus-sign, thanks lintian. * Added an audacity-dbg debug package. * Versioned Build-Depends on libsoundtouch1-dev (>= 1.3.1-2) and explicitely enable it in the configure flags (Closes: #459198). * Added advice to also remove '~/.audacity' to debian/NEWS (Closes: #463955). * Added Build-Conflicts against libwxbase2.6-dev and wx2.6-headers (Closes: #405623). * Explicitely built against the system libsamplerate, effectively disabling the internal libresample. This may break support for proprietary VST plug-ins! Left a notice in debian/NEWS. * Reordered configure flags in debian/rules and renamed T1_DEB_CONFIGURE_EXTRA_FLAGS to the more descriptive WITH_JACK_CONFFLAG. * Audacity suggests libmp3lame0. * Added an arch:all audacity-data package that contains most of the architecture-independent content of the '/usr/share' directory. * Fixed faulty confflags --with-libid3tag and --with-libvorbis. * Remove the redundant LICENSE.txt file immediately after the install rule. * Do not manually remove lib-src/libpormixer.a in the clean rule. We build --without-portmixer anyway. -- Fabian Greffrath Tue, 20 Jan 2009 15:45:00 +0100 audacity (1.3.6-2) unstable; urgency=low * Set Maintainer to pkg-multimedia-maintainers * Add Vcs-Git and Vcs-Browser URLs -- Free Ekanayaka Mon, 12 Jan 2009 08:30:59 +0000 audacity (1.3.6-1) unstable; urgency=low * New upstream version * Drop ratefix patch, merged upstream * Add pulseaudio patch (thanks to David Henningsson) * Build depend on libwxgtk2.8-dev instead of libwxgtk2.6-dev * Set Maintainer to pkg-multimedia-maintainers * Add Vcs-Git and Vcs-Browser URLs -- Free Ekanayaka Sun, 11 Jan 2009 23:54:44 +0000 audacity (1.3.5-2) unstable; urgency=low * Applied ratefix.patch which fixes a project rate issue when exporting to wav (Closes: #481641), thanks to Paul Martin -- Free Ekanayaka Mon, 19 May 2008 11:51:25 +0100 audacity (1.3.5-1) unstable; urgency=low * New upstream release * Included patches from Ubuntu (thanks to Bruno Barrera Yever): - debian/patches/desktop_file.patch: - removed deprecated Encoding field - removed deprecated Application value from Categories - updated Name fields - updated Icon field * Removed liblame patch, included upstream -- Free Ekanayaka Wed, 14 May 2008 13:54:33 +0100 audacity (1.3.4-1.2) unstable; urgency=medium * Non-maintainer upload. * Fix FTBFS with GCC 4.3 (Closes: #455635). * Reenable JACK on amd64 (Closes: #469325). -- Luk Claes Sat, 22 Mar 2008 10:50:11 +0000 audacity (1.3.4-1.1) unstable; urgency=high * Non-maintainer upload by security team. * Fix insecure directory creation in /tmp by moving the directory to the users home directory (CVE-2007-6061; Closes: #453283). * Adding NEWS file to advise the user to change the tmp path in his config file so there is a notification for users who are already vulnerable. -- Nico Golde Mon, 21 Jan 2008 19:08:54 +0100 audacity (1.3.4-1) unstable; urgency=low [ Joost Yervante Damad ] * Survived the library transition (Closes: #426636) * Disable portmixer as recommended (Closes: #454241) * only enable jack on i386 and powerpc (See also #406754) [ Free Ekanayaka ] * New upstream release * Force removal of lib-src/libportmixer.a when cleaning (Closes #442497) * Fixed watch file (Closes: #449637) * Dropped no more needed desktop, kfreebsd and see patches -- Free Ekanayaka Tue, 18 Dec 2007 21:15:12 +0000 audacity (1.3.3-1) unstable; urgency=low * New upstream release * Added watch file * debian/patches: - updated libmp3lame patch * debian/control: - as suggested upstream, depend on libgtk2.0-dev, otherwise the code fails to build -- Free Ekanayaka Fri, 18 May 2007 12:11:05 +0200 audacity (1.3.2-4) unstable; urgency=low * debian/patches: - desktop_file.patch: fixed broken Category entry * debian/audacity.mime: - added entry for application/x-audacity-project -- Free Ekanayaka Thu, 17 May 2007 02:36:41 +0200 audacity (1.3.2-3) unstable; urgency=low [ Joost Yervante Damad ] * Add patch by Joo Martin to fix installation of the locales (Closes: #416864, #422338) * Add patch based on work by Mikael Magnusson that enables usage of the portaudio library on the system, however it doesn't work, because portmixer doesn't compile against it, soo we're not using it yet. * Apply changes from #423477 (Closes: #423477) - transparent background for icons - /usr/share/audacity => /usr/share/pixmaps * Look for libmp3lame.so.0 iso libmp3lame.so (Closes: #410516) [ Free Ekanayaka ] * Add icon for .aup files -- Joost Yervante Damad Sat, 12 May 2007 13:09:13 +0200 audacity (1.3.2-2) unstable; urgency=high [Joost Yervante Damad] * audacity - FTBFS: error: unrecognized command line option "-msse" (Closes: #409255) Fixed by building the sse file only with -msse on i386 and amd64 archs [ Free Ekanayaka ] * FTBFS on GNU/kFreeBSD (Closes: #409260) -- Joost Yervante Damad Fri, 23 Mar 2007 11:00:39 +0100 audacity (1.3.2-1) unstable; urgency=low [ Michael Biebl ] * New upstream release for GTK2 and ALSA. * debian/control - Add build-dep on libexpat1-dev, libjack0.100.0-dev, libasound2-dev. - Build against libwxgtk2.6-dev. (Closes: #340409, #379616) * debian/rules - Enable portaudio v19 (ALSA). (Closes: #249157) - Enable unicode. (Closes: #298548) - Use system expat library. * Ship the desktop file provided by upstream, drop debian/audacity.desktop. * Use debhelper v5 compat mode. * Update FSF address in debian/copyright. * Update to Standards-Version 3.7.2, no further changes required. [ Free Ekanayaka ] * Depend on libjack-dev rather that libjack0.100.0-dev, which is now obsolete * Set Maintainer to Debian Multimedia Team * Added Matt and myself to Uploaders -- Free Ekanayaka Tue, 16 Jan 2007 15:53:30 +0100 audacity (1.2.4b-2.1) unstable; urgency=low * NMU as part of the GCC 4.1 transition. * Remove extra qualification from C++ header file (closes: #357056). -- Martin Michlmayr Fri, 26 May 2006 12:26:18 +0200 audacity (1.2.4b-2) unstable; urgency=low * src/effects/Silence.cpp: Fix bug that caused Generate Silence to affect all tracks instead of just the selected ones. * debian/copyright: Update FSF address. * de.po: Fix translation mistakes (closes: #313667). Patch from Jens Seidel. * Fix build on GNU/kFreeBSD (closes: #345201). Patch from Aurelien Jarno. -- Matt Brubeck Fri, 13 Jan 2006 20:08:04 -0800 audacity (1.2.4b-1) unstable; urgency=low * New upstream release - Fixed encoding error in French localization. * debian/control: Updated my email address. -- Matt Brubeck Mon, 19 Dec 2005 17:46:43 -0800 audacity (1.2.4-1) unstable; urgency=low * New upstream release - debian/rules, debian/control, debian/audacity.mime: Build new FLAC import support (closes: #329801, #329824). * debian/control: - Update Standards-Version to 3.6.2. - Add Build-Conflicts with libwxgtk2.6-dev. * debian/audacity.mime: Reduce priorities (closes: #327234). * debian/patches/001-allegro-gcc4.diff: Removed (merged upstream). -- Matt Brubeck Sat, 26 Nov 2005 18:38:48 -0800 audacity (1.2.3-2) unstable; urgency=low * Build against libwxgtk2.4-1 (closes: #320995). * 001-allegro-gcc4.diff (from Andreas Jochens) - Fix AMD64/gcc4 compilation error (closes: #285481). * debian/control: Add Build-Conflicts with libwxgtk2.5-dev. * debian/copyright: Refer to specific versions of (L)GPL from common-licenses. Remove extraneous characters from SoundTouch license notice. (Thanks to Marc 'HE' Brockschmidt.) -- Matt Brubeck Tue, 2 Aug 2005 20:53:09 -0700 audacity (1.2.3-1) unstable; urgency=low * New upstream release - Fall back to default help file path if custom path is wrong (closes: #275345). -- Matt Brubeck Fri, 19 Nov 2004 11:53:04 -0800 audacity (1.2.2-2) unstable; urgency=low * debian/copyright: Add copyright information and original licenses for other libraries included in the Audacity source package. * debian/audacity.desktop: Add a .desktop file (closes: #281193). * debian/rules, debian/control: Run dh_desktop; Build-Depends on debhelper (>=4.2.21). -- Matt Brubeck Sat, 16 Oct 2004 10:35:44 -0700 audacity (1.2.2-1) unstable; urgency=low * New upstream release (closes: #268360). -- Matt Brubeck Wed, 1 Sep 2004 22:29:13 -0700 audacity (1.2.1.91-1) unstable; urgency=low * New upstream pre-release. -- Matt Brubeck Mon, 9 Aug 2004 20:24:38 -0700 audacity (1.2.1-4) unstable; urgency=low * Really install audacity.mime. -- Matt Brubeck Sun, 18 Jul 2004 19:28:41 -0700 audacity (1.2.1-3) unstable; urgency=low * debian/copyright: Update maintainer information. * Use dh_install to install menu icons. * Don't gzip the HTB (online help) file, which is already compressed (closes: #256562). * Remove extra file LICENSE.txt in debian/rules instead of patching upstream Makefile. -- Matt Brubeck Sun, 11 Jul 2004 17:14:51 -0700 audacity (1.2.1-2) unstable; urgency=low * debian/patches/dirmanager-hash.diff: Fix a dataloss bug when editing a saved project file with duplicated data (patch from upstream CVS). * locale/ru.po: Fix character encoding of Russian translation by reverting to file from 1.2.0. * Add "icon" line to menu file (closes: #252853). * Register as a MIME handler (closes: #255893). -- Matt Brubeck Fri, 25 Jun 2004 13:54:27 -0700 audacity (1.2.1-1) unstable; urgency=low * New upstream release - Removes debugging output from Import Raw (closes: #245665). - Fixes crash when Equalization window is too small (closes: #243767). -- Matt Brubeck Sat, 8 May 2004 12:19:48 -0700 audacity (1.2.0-3) unstable; urgency=low * Fix nyquist build on MIPS, and re-enable nyquist on all platforms. Patch from Stephen Gildea (closes: #241488). * Use smaller image as window icon (closes: #242856). * Update autotools helper files config.guess and config.sub. * Add Suggests: ladspa-plugin. * Add a menu icon. -- Matt Brubeck Sat, 10 Apr 2004 10:36:34 -0700 audacity (1.2.0-2) unstable; urgency=low * Fix endianness problem on PowerPC (closes: #232972). -- Matt Brubeck Sat, 27 Mar 2004 11:11:11 -0800 audacity (1.2.0-1) unstable; urgency=low * New upstream release (closes: #234746). * New maintainer. * Update Standards-Version to 3.6.1.0. * Remove libsamplerate dependency (replaced by libresample). * Fix compilation error in soundtouch. Patch from Matt Kraai (closes: #236990). * Fix "make distclean" to remove all configure-generated files. * Remove outdated information from copyright file. * Remove duplicate license file LICENSE.txt. * Properly quote values in menu file. * Acknowledge NMU (closes: #213193, #194509, #223248, #220365, #221176). -- Matt Brubeck Tue, 16 Mar 2004 15:11:03 -0800 audacity (1.1.99pre3-1) unstable; urgency=low * Add 'zip' to Build-deps. Previously zip was in non-US which required me to pre-zip the help file before uploading, but this is no longer the case. (closes: #226261) * The rebuild should resolve the runtime link warnings and crashes (closes: #227903) * Nyquist is no longer configured to be part of the build. It prevents mips and mipsel from building correctly, and no one is prepared to fix the problems at this time. -- Joshua Haberman Thu, 15 Jan 2004 18:48:10 -0800 audacity (1.1.99pre3-0.1) unstable; urgency=low * new upstream, hopefully closes: #213193, #194509 * recompiled with newer libs, closes: #223248, #220365, #221176 * NMU -- Torsten Werner Wed, 31 Dec 2003 13:40:24 +0100 audacity (1.1.99pre1-2) unstable; urgency=low * Prevent audacity-1.2-help.htb from being gzipped, so online help works correctly * Changes to configure.in, such as recognizing when libsndfile is not present * Build-depend on libsndfile1-dev, so autobuilders won't fail (closes: #204334) -- Joshua Haberman Wed, 6 Aug 2003 18:24:02 +0000 audacity (1.1.99pre1-1) unstable; urgency=low * New upstream 1.2 prerelease. Far too many new features to list. * Audacity 1.2 does not support opening MIDI files, so the Open Midi -> Export Ogg crash is no longer triggerable (closes: #150654) * Audacity 1.2 performs checks to guard against multiple instances running concurrently, to prevent multiple instances from interfering with each others temporary files. (closes: #182782) * We now use libsndfile for sound file i/o, so 8 bit files should no longer be distorted. (closes: #187304) * Recompile should fix weird, unexplainable, unreproducable runtime linking error. (closes: #187504) * Audacity 1.2 has a completely new audio i/o backend. The code that caused a problem when changing devices in the preferences has been completely rewritten. (closes: #188808) * We no longer link against id3lib (thank goodness) so the FTBFS that was clearly caused by id3lib should no longer be an issue. (closes: #192328) * "<" and ">" removed from URL display to prevent the URL from disappearing entirely from the packages.d.o web pages that don't properly escape them. (closes: #196660) -- Joshua Haberman Tue, 5 Aug 2003 20:15:07 +0000 audacity (1.0.1-1) unstable; urgency=low * New minor upstream release * Moved binary and manpages out of /usr/X11R6 (closes: #171403) * The recompile will solve the libvorbis0 dependency problem (closes: #185387, #185078) * The recompile should also solve problems with the dynamic linker not finding the correct libstdc++. (closes: #184905) -- Joshua Haberman Tue, 25 Mar 2003 01:33:47 +0000 audacity (1.0.0-1.1) unstable; urgency=low * NMU to fix breakage caused by libvorbis0 split. -- Christopher L Cheney Mon, 29 Jul 2002 22:00:00 -0500 audacity (1.0.0-1) unstable; urgency=low * New upstream release (1.0.0, woohoo!) * More 64-bit platform patches (closes: #145537) -- Joshua Haberman Fri, 14 Jun 2002 23:55:23 -0700 audacity (0.98-3) unstable; urgency=low * Applied fix that caused file importing to fail on platforms where sizeof(long) != 4. (closes: #140417) -- Joshua Haberman Sun, 14 Apr 2002 02:40:17 -0700 audacity (0.98-2) unstable; urgency=low * New build-depends on libwxgtk2.2-dev (>=2.2.9.2) should solve any remaining libpng problems. This will effectively revert us back to libpng2, since this is what the libwxgtk2.2 maintainer decided on. -- Joshua Haberman Wed, 6 Mar 2002 20:12:42 -0800 audacity (0.98-1) unstable; urgency=low * Full upstream release. * All effects will correctly cancel now. (closes: #129381) * Fixed subtle but serious bug in libmad mp3 importing code that would randomly cause freezes when importing mp3s. (closes: #129380) * Build-depends on wxWindows and libpng are versioned to force libpng3 for both. (closes: #128463) -- Joshua Haberman Tue, 22 Jan 2002 23:51:20 -0800 audacity (0.97.2-1) unstable; urgency=low * Eliminated build-dependency on 'zip' by pre-zipping the help file. I was previously unaware that zip is in non-us, making the build-dep a policy violation. Unfortunately, this required a new source tarball, since Debian diffs don't seem to allow binary files. -- Joshua Haberman Tue, 1 Jan 2002 22:47:26 -0800 audacity (0.97.1-1) unstable; urgency=low * Upstream prerelease. Upstream we have fixed many important bugs, but the next full release may not be ready for Debian's freeze. These fixes should definitely go in woody. * Audacity no longer includes its own complete copy of libmpeg3 and id3lib; instead we link against the debian packages libmad0-dev and libid3-dev. This effectively sidesteps the problems of id3lib building (or not building) on 64 bit architectures. (closes: #121599, #123132, #126769) * improved debian/rules to more completely "make clean." (closes: #126761) -- Joshua Haberman Sat, 29 Dec 2001 21:05:46 -0800 audacity (0.97-1) unstable; urgency=low * Upstream release * Updated config.guess and config.sub from upstream (closes: bug#115361) -- Joshua Haberman Sat, 13 Oct 2001 14:37:49 -0700 audacity (0.96-1) unstable; urgency=low * Upstream release -- Joshua Haberman Mon, 6 Aug 2001 16:37:53 -0700 audacity (0.95-2) unstable; urgency=low * re-eliminated architecture-specific flags from compilation of libmpeg3 (forgot to fix upstream before this release) (closes: bug#96750) -- Joshua Haberman Tue, 8 May 2001 23:12:34 -0700 audacity (0.95-1) unstable; urgency=low * Upstream release -- Joshua Haberman Mon, 30 Apr 2001 16:19:00 -0700 audacity (0.94c-2) unstable; urgency=low * eliminated architecture-specific flags from compilation of libmpeg3 (closes: bug#92410) * added support for the help system -- Joshua Haberman Sun, 1 Apr 2001 00:18:25 -0800 audacity (0.94c-1) unstable; urgency=low * Initial Release. -- Joshua Haberman Wed, 25 Mar 2001 19:56:13 -0800 debian/compat0000664000000000000000000000000212231441137010364 0ustar 9 debian/source_audacity.py0000664000000000000000000000116412231441137012725 0ustar '''apport package hook for audacity Author: David Henningsson ''' from apport.hookutils import * import os.path import re def add_info(report): # we probably don't need all alsa_base info, but some hint # of the user's soundcards would be nice. report['AlsaCards'] = command_output(['cat', '/proc/asound/cards']) cfgfilename = os.path.expanduser('~/.audacity-data/audacity.cfg') if os.path.exists(cfgfilename): s = open(cfgfilename).read() # give the user some privacy by removing MRU file list s = re.sub(r'\n(file[0-9]+=)[^\n]*', r'\n\1(removed for privacy)', s) report['AudacityCfg'] = s debian/watch0000664000000000000000000000025012231441137010214 0ustar version=3 opts="uversionmangle=s/-beta//;s/\.?rc/~rc/" \ http://code.google.com/p/audacity/downloads/list?can=1&num=1000 \ .*/audacity-minsrc-(.+)\.tar\.(?:bz2|xz) debian/patches/0000775000000000000000000000000012344164731010624 5ustar debian/patches/series0000664000000000000000000000007212342434377012044 0ustar distclean.patch fix-ladspa-search-path.patch ffmpeg.patch debian/patches/distclean.patch0000664000000000000000000001260712231454437013621 0ustar Description: Improve distclean target. distclean will be run for every subdirectory that contains a Makefile instead of speculatively calling distclean on every subdirectory and ignoring errors. Author: Benjamin Drung --- a/Makefile.in +++ b/Makefile.in @@ -149,8 +149,10 @@ clean: $(MAKE) -C lib-src clean + $(MAKE) -C locale clean + test ! -f tests/Makefile || $(MAKE) -C tests clean $(MAKE) -C src clean - -$(MAKE) -C tests clean + rm -f audacity rm -f help/audacity.1.gz rm -rf Audacity.app @@ -163,11 +165,11 @@ rm -f `find . -name core` distclean: clean - $(MAKE) -C locale distclean $(MAKE) -C lib-src distclean - -$(MAKE) -C tests distclean + $(MAKE) -C locale distclean + test ! -f tests/Makefile || $(MAKE) -C tests distclean + $(MAKE) -C src distclean - rm -f Makefile src/Makefile lib-src/Makefile - rm -f locale/Makefile src/configunix.h + rm -f Makefile rm -f config.log config.status config.cache --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -150,52 +150,53 @@ # Utility rules clean: - -$(MAKE) -C portsmf clean - -$(MAKE) -C expat clean - -$(MAKE) -C FileDialog clean - -$(MAKE) -C libid3tag clean - -$(MAKE) -C libmad clean - -$(MAKE) -C libnyquist clean - -$(MAKE) -C liblrdf clean - -$(MAKE) -C libogg clean - -$(MAKE) -C libsoxr clean - -$(MAKE) -C libsamplerate clean - -$(MAKE) -C libresample clean - -$(MAKE) -C libsndfile clean - -$(MAKE) -C libvamp clean - -$(MAKE) -C libvorbis clean - -$(MAKE) -C lib-widget-extra clean - -$(MAKE) -C libflac clean - -$(MAKE) -C portaudio-v19 clean - -$(MAKE) -C portmixer clean - -$(MAKE) -C sbsms clean - -$(MAKE) -C soundtouch clean - -$(MAKE) -C twolame clean - -rm -rf @LOCAL_LIBS@ + test ! -f portsmf/Makefile || $(MAKE) -C portsmf clean + test ! -f expat/Makefile || $(MAKE) -C expat clean + test ! -f FileDialog/Makefile || $(MAKE) -C FileDialog clean + test ! -f libid3tag/Makefile || $(MAKE) -C libid3tag clean + test ! -f libmad/Makefile || $(MAKE) -C libmad clean + test ! -f libnyquist/Makefile || $(MAKE) -C libnyquist clean + test ! -f liblrdf/Makefile || $(MAKE) -C liblrdf clean + test ! -f libogg/Makefile || $(MAKE) -C libogg clean + test ! -f libsoxr/Makefile || $(MAKE) -C libsoxr clean + test ! -f libsamplerate/Makefile || $(MAKE) -C libsamplerate clean + test ! -f libresample/Makefile || $(MAKE) -C libresample clean + test ! -f libsndfile/Makefile || $(MAKE) -C libsndfile clean + test ! -f libvamp/Makefile || $(MAKE) -C libvamp clean + test ! -f libvorbis/Makefile || $(MAKE) -C libvorbis clean + test ! -f lib-widget-extra/Makefile || $(MAKE) -C lib-widget-extra clean + test ! -f libflac/Makefile || $(MAKE) -C libflac clean + test ! -f portaudio-v19/Makefile || $(MAKE) -C portaudio-v19 clean + test ! -f portmixer/Makefile || $(MAKE) -C portmixer clean + test ! -f sbsms/Makefile || $(MAKE) -C sbsms clean + test ! -f soundtouch/Makefile || $(MAKE) -C soundtouch clean + test ! -f twolame/Makefile || $(MAKE) -C twolame clean + rm -f @LOCAL_LIBS@ distclean: - -$(MAKE) -C portsmf distclean - -$(MAKE) -C expat distclean - -$(MAKE) -C FileDialog distclean - -$(MAKE) -C libid3tag distclean - -$(MAKE) -C libmad distclean - -$(MAKE) -C libnyquist distclean - -$(MAKE) -C liblrdf distclean - -$(MAKE) -C libogg distclean - -$(MAKE) -C libsoxr distclean - -$(MAKE) -C libsamplerate distclean - -$(MAKE) -C libresample distclean - -$(MAKE) -C libsndfile distclean - -$(MAKE) -C libvamp distclean - -$(MAKE) -C libvorbis distclean - -$(MAKE) -C lib-widget-extra distclean - -$(MAKE) -C libflac distclean - -$(MAKE) -C portaudio-v19 distclean - -$(MAKE) -C portmixer distclean - -$(MAKE) -C sbsms distclean - -$(MAKE) -C soundtouch distclean - -$(MAKE) -C twolame distclean - -rm -f @LOCAL_LIBS@ + test ! -f portsmf/Makefile || $(MAKE) -C portsmf distclean + test ! -f expat/Makefile || $(MAKE) -C expat distclean + test ! -f FileDialog/Makefile || $(MAKE) -C FileDialog distclean + test ! -f libid3tag/Makefile || $(MAKE) -C libid3tag distclean + test ! -f libmad/Makefile || $(MAKE) -C libmad distclean + test ! -f libnyquist/Makefile || $(MAKE) -C libnyquist distclean + test ! -f liblrdf/Makefile || $(MAKE) -C liblrdf distclean + test ! -f libogg/Makefile || $(MAKE) -C libogg distclean + test ! -f libsoxr/Makefile || $(MAKE) -C libsoxr distclean + test ! -f libsamplerate/Makefile || $(MAKE) -C libsamplerate distclean + test ! -f libresample/Makefile || $(MAKE) -C libresample distclean + test ! -f libsndfile/Makefile || $(MAKE) -C libsndfile distclean + test ! -f libvamp/Makefile || $(MAKE) -C libvamp distclean + test ! -f libvorbis/Makefile || $(MAKE) -C libvorbis distclean + test ! -f lib-widget-extra/Makefile || $(MAKE) -C lib-widget-extra distclean + test ! -f libflac/Makefile || $(MAKE) -C libflac distclean + test ! -f portaudio-v19/Makefile || $(MAKE) -C portaudio-v19 distclean + test ! -f portmixer/Makefile || $(MAKE) -C portmixer distclean + test ! -f sbsms/Makefile || $(MAKE) -C sbsms distclean + test ! -f soundtouch/Makefile || $(MAKE) -C soundtouch distclean + test ! -f twolame/Makefile || $(MAKE) -C twolame distclean + rm -f @LOCAL_LIBS@ + rm -f Makefile # list here all the targets that aren't actually files to be made .PHONY: portsmf-recursive eexpat-recursive FileDialog-recursive \ --- a/src/Makefile.in +++ b/src/Makefile.in @@ -338,6 +338,9 @@ rm -rf $(OBJS) $(LIBAUDACITY_OBJS) rm -f libaudacity.a AudacityHeaders.h.gch +distclean: clean + rm -f configunix.h Makefile + # # Rule for compiling C++ files # debian/patches/ffmpeg.patch0000664000000000000000000042455412344164731013127 0ustar Description: Add support for recent FFmpeg/libav versions This patch adds support for libav >= 0.8 (including libav 9 and 10) and FFmpeg >= 1.2 and drops support for libav < 0.8 and FFmpeg < 1.2. The changed source files are directly copied from SVN revision 13171. Author: Michael Niedermayer and Benjamin Drung Bug: http://bugzilla.audacityteam.org/show_bug.cgi?id=540 Bug-Debian: http://bugs.debian.org/740755 Bug-Ubuntu: https://launchpad.net/bugs/1076928 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -17,7 +17,7 @@ // Store function pointers here when including FFmpeg.h #define DEFINE_FFMPEG_POINTERS -#include "Audacity.h" // for config*.h +#include "Audacity.h" // for config*.h #include "FFmpeg.h" #include "AudacityApp.h" #include "FileNames.h" @@ -25,16 +25,6 @@ #include -#ifdef _DEBUG - #ifdef _MSC_VER - #undef THIS_FILE - static char*THIS_FILE= __FILE__; - #define new new(_NORMAL_BLOCK, THIS_FILE, __LINE__) - #endif -#endif - -#define UFILE_PROTOCOL "ufile" - #if !defined(USE_FFMPEG) /// FFmpeg support may or may not be compiled in, /// but Preferences dialog requires this function nevertheless @@ -81,8 +71,8 @@ PickFFmpegLibs(); if (FFmpegLibsInst->ValidLibsLoaded()) { - DropFFmpegLibs(); - return true; + DropFFmpegLibs(); + return true; } if (!FFmpegLibsInst->LoadLibs(NULL,showerror)) { @@ -135,7 +125,7 @@ void av_log_wx_callback(void* ptr, int level, const char* fmt, va_list vl) { //Most of this stuff is taken from FFmpeg tutorials and FFmpeg itself - int av_log_level = AV_LOG_WARNING; + int av_log_level = AV_LOG_INFO; AVClass* avc = ptr ? *(AVClass**)ptr : NULL; if (level > av_log_level) return; @@ -165,7 +155,7 @@ } #ifdef EXPERIMENTAL_OD_FFMPEG //if the decoding happens thru OD then this gets called from a non main thread, which means wxLogDebug -//will crash. +//will crash. //TODO:find some workaround for the log. perhaps use ODManager as a bridge. for now just print if(!wxThread::IsMain()) printf("%s: %s\n",(char*)cpt.char_str(),(char*)printstring.char_str()); @@ -177,56 +167,18 @@ //======================= Unicode aware uri protocol for FFmpeg // Code inspired from ffmpeg-users mailing list sample -static int ufile_open(URLContext *h, const char *filename, int flags) +static int ufile_read(void *opaque, uint8_t *buf, int size) { - wxString name(strchr(filename, ':') + 1, wxConvUTF8); - wxFile *f; - wxFile::OpenMode mode; - - f = new wxFile; - if (!f) { - return AVERROR(ENOMEM); - } - - // LLL: These really should be logical AND tests, but on 2011/04/28, the URL_ open flags - // changed in the FFmpeg source to values that were not compatible with previous - // values. - // - // Since Audacity doesn't use any other open flags (there aren't any others defined - // anyway), making equality tests works for older and new FFmpeg headers. - if (flags == URL_RDWR) { - mode = wxFile::read_write; - } else if (flags == URL_WRONLY) { - mode = wxFile::write; - } else { - mode = wxFile::read; - } - - if (!f->Open(name, mode)) { - delete f; - return AVERROR(ENOENT); - } - - h->priv_data = (void *)f; - - return 0; + int ret = (int)((wxFile *) opaque)->Read(buf, size); + return ret; } -static int ufile_read(URLContext *h, unsigned char *buf, int size) +static int ufile_write(void *opaque, uint8_t *buf, int size) { - return (int) ((wxFile *) h->priv_data)->Read(buf, size); + return (int) ((wxFile *) opaque)->Write(buf, size); } -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 68, 0) -static int ufile_write(URLContext *h, unsigned char *buf, int size) -#else -static int ufile_write(URLContext *h, const unsigned char *buf, int size) -#endif -{ - return (int) ((wxFile *) h->priv_data)->Write(buf, size); -} - -static int64_t ufile_seek(URLContext *h, int64_t pos, int whence) +static int64_t ufile_seek(void *opaque, int64_t pos, int whence) { wxSeekMode mode = wxFromStart; @@ -237,73 +189,73 @@ switch (whence & ~AVSEEK_FORCE) { case (SEEK_SET): - mode = wxFromStart; - break; + mode = wxFromStart; + break; case (SEEK_CUR): - mode = wxFromCurrent; - break; + mode = wxFromCurrent; + break; case (SEEK_END): - mode = wxFromEnd; - break; + mode = wxFromEnd; + break; case (AVSEEK_SIZE): - return ((wxFile *) h->priv_data)->Length(); + return ((wxFile *) opaque)->Length(); } - return ((wxFile *) h->priv_data)->Seek(pos, mode); + return ((wxFile *) opaque)->Seek(pos, mode); } -static int ufile_close(URLContext *h) +int ufile_close(AVIOContext *pb) { - wxFile *f = (wxFile *) h->priv_data; + wxFile *f = (wxFile *) pb->opaque; if (f) { f->Close(); delete f; } - return 0; + return 0; } -URLProtocol ufile_protocol = { - UFILE_PROTOCOL, - ufile_open, - ufile_read, - ufile_write, - ufile_seek, - ufile_close, -}; - // Open a file with a (possibly) Unicode filename int ufile_fopen(AVIOContext **s, const wxString & name, int flags) { - wxString url(wxString(wxT(UFILE_PROTOCOL)) + wxT(":") + name); - URLContext *h; - int err; + wxFile *f; + wxFile::OpenMode mode; + + f = new wxFile; + if (!f) { + return ENOMEM; + } + + if (flags == (AVIO_FLAG_READ | AVIO_FLAG_WRITE)) { + delete f; + return EINVAL; + } else if (flags == AVIO_FLAG_WRITE) { + mode = wxFile::write; + } else { + mode = wxFile::read; + } - // Open the file using our custom protocol and passing the (possibly) Unicode - // filename. We convert the name to UTF8 here and it will be converted back - // to original encoding in ufile_open(). This allows us to support Unicode - // filenames even though FFmpeg does not. - err = url_open(&h, (const char *) url.ToUTF8(), flags); - if (err < 0) { - return err; + if (!f->Open(name, mode)) { + delete f; + return ENOENT; } - // Associate the file with a context - err = url_fdopen(s, h); - if (err < 0) { - url_close(h); - return err; + *s = avio_alloc_context((unsigned char*)av_malloc(32768), 32768, + flags & AVIO_FLAG_WRITE, + /*opaque*/f, + ufile_read, + ufile_write, + ufile_seek); + if (!*s) { + delete f; + return ENOMEM; } return 0; } -// Size of probe buffer, for guessing file type from file contents -#define PROBE_BUF_MIN 2048 -#define PROBE_BUF_MAX (1<<20) - // Detect type of input file and open it if recognized. Routine // based on the av_open_input_file() libavformat function. int ufile_fopen_input(AVFormatContext **ic_ptr, wxString & name) @@ -311,110 +263,32 @@ wxFileName f(name); wxCharBuffer fname; const char *filename; - AVProbeData pd; AVIOContext *pb = NULL; - AVInputFormat *fmt = NULL; - AVInputFormat *fmt1; - int probe_size; int err; - // Create a dummy file name using the extension from the original - f.SetName(wxT(UFILE_PROTOCOL)); fname = f.GetFullName().mb_str(); filename = (const char *) fname; - // Initialize probe data...go ahead and preallocate the maximum buffer size. - pd.filename = filename; - pd.buf_size = 0; - pd.buf = (unsigned char *) av_malloc(PROBE_BUF_MAX + AVPROBE_PADDING_SIZE); - if (pd.buf == NULL) { - err = AVERROR(ENOMEM); - goto fail; - } - // Open the file to prepare for probing - if ((err = ufile_fopen(&pb, name, URL_RDONLY)) < 0) { + if ((err = ufile_fopen(&pb, name, AVIO_FLAG_READ)) < 0) { goto fail; } - for (probe_size = PROBE_BUF_MIN; probe_size <= PROBE_BUF_MAX && !fmt; probe_size <<= 1) { - int score_max = probe_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX / 4 : 0; - - // Read up to a "probe_size" worth of data - pd.buf_size = avio_read(pb, pd.buf, probe_size); - - // AWD: with zero-length input files buf_size can come back negative; - // this causes problems so we might as well just fail - if (pd.buf_size < 0) { - err = AVERROR_INVALIDDATA; - goto fail; - } - - // Clear up to a "AVPROBE_PADDING_SIZE" worth of unused buffer - memset(pd.buf + pd.buf_size, 0, AVPROBE_PADDING_SIZE); - - // Reposition file for succeeding scan - if (avio_seek(pb, 0, SEEK_SET) < 0) { - err = AVERROR(EIO); - goto fail; - } - - // Scan all input formats - fmt = NULL; - for (fmt1 = av_iformat_next(NULL); fmt1 != NULL; fmt1 = av_iformat_next(fmt1)) { - int score = 0; - - // Ignore the ones that are not file based - if (fmt1->flags & AVFMT_NOFILE) { - continue; - } - - // If the format can probe the file then try that first - if (fmt1->read_probe) { - score = fmt1->read_probe(&pd); - } - // Otherwize, resort to extension matching if available - else if (fmt1->extensions) { - if (av_match_ext(filename, fmt1->extensions)) { - score = 50; - } - } - - // Remember this format if it scored higher than a previous match - if (score > score_max) { - score_max = score; - fmt = fmt1; - } - else if (score == score_max) { - fmt = NULL; - } - } - } - - // Didn't find a suitable format, so bail - if (!fmt) { - err = AVERROR(EILSEQ); - goto fail; - } + *ic_ptr = avformat_alloc_context(); + (*ic_ptr)->pb = pb; // And finally, attempt to associate an input stream with the file - err = av_open_input_stream(ic_ptr, pb, filename, fmt, NULL); + err = avformat_open_input(ic_ptr, filename, NULL, NULL); if (err) { goto fail; } - // Done with the probe buffer - av_freep(&pd.buf); - return 0; fail: - if (pd.buf) { - av_freep(&pd.buf); - } if (pb) { - avio_close(pb); + ufile_close(pb); } *ic_ptr = NULL; @@ -461,7 +335,7 @@ int import_ffmpeg_decode_frame(streamContext *sc, bool flushing) { - int nBytesDecoded; + int nBytesDecoded; wxUint8 *pDecode = sc->m_pktDataPtr; int nDecodeSiz = sc->m_pktRemainingSiz; @@ -482,10 +356,32 @@ } } + AVPacket avpkt; + av_init_packet(&avpkt); + avpkt.data = pDecode; + avpkt.size = nDecodeSiz; + + AVFrame *frame = av_frame_alloc(); + int got_output = 0; + + nBytesDecoded = + avcodec_decode_audio4(sc->m_codecCtx, + frame, // out + &got_output, // out + &avpkt); // in + + if (nBytesDecoded < 0) + { + // Decoding failed. Don't stop. + return -1; + } + sc->m_samplefmt = sc->m_codecCtx->sample_fmt; - sc->m_samplesize = av_get_bits_per_sample_format(sc->m_samplefmt) / 8; + sc->m_samplesize = av_get_bytes_per_sample(sc->m_samplefmt); - unsigned int newsize = FFMAX(sc->m_pkt.size * sc->m_samplesize, AVCODEC_MAX_AUDIO_FRAME_SIZE); + int channels = sc->m_codecCtx->channels; + unsigned int newsize = sc->m_samplesize * frame->nb_samples * channels; + sc->m_decodedAudioSamplesValidSiz = newsize; // Reallocate the audio sample buffer if it's smaller than the frame size. if (newsize > sc->m_decodedAudioSamplesSiz ) { @@ -503,38 +399,20 @@ return -1; } } - - - sc->m_decodedAudioSamplesValidSiz = sc->m_decodedAudioSamplesSiz; - -#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 25, 0) - // avcodec_decode_audio3() expects the size of the output buffer as the 3rd parameter but - // also returns the number of bytes it decoded in the same parameter. - AVPacket avpkt; - av_init_packet(&avpkt); - avpkt.data = pDecode; - avpkt.size = nDecodeSiz; - nBytesDecoded = - avcodec_decode_audio3(sc->m_codecCtx, - (int16_t *)sc->m_decodedAudioSamples, // out - &sc->m_decodedAudioSamplesValidSiz, // in/out - &avpkt); // in -#else - // avcodec_decode_audio2() expects the size of the output buffer as the 3rd parameter but - // also returns the number of bytes it decoded in the same parameter. - nBytesDecoded = - avcodec_decode_audio2(sc->m_codecCtx, - (int16_t *) sc->m_decodedAudioSamples, // out - &sc->m_decodedAudioSamplesValidSiz, // in/out - pDecode, // in - nDecodeSiz); // in -#endif - if (nBytesDecoded < 0) - { - // Decoding failed. Don't stop. - return -1; + if (frame->data[1]) { + for (int i = 0; inb_samples; i++) { + for (int ch = 0; chm_decodedAudioSamples + sc->m_samplesize * (ch + channels*i), + frame->extended_data[ch] + sc->m_samplesize*i, + sc->m_samplesize); + } + } + } else { + memcpy(sc->m_decodedAudioSamples, frame->data[0], newsize); } + av_frame_free(&frame); + // We may not have read all of the data from this packet. If so, the user can call again. // Whether or not they do depends on if m_pktRemainingSiz == 0 (they can check). sc->m_pktDataPtr += nBytesDecoded; @@ -636,7 +514,7 @@ "Where would I find the file '%s'?" instead if you want. */ question.Printf(_("Where is '%s'?"), mName.c_str()); - wxString path = FileSelector(question, + wxString path = FileSelector(question, mLibPath.GetPath(), mLibPath.GetName(), wxT(""), @@ -723,7 +601,7 @@ else { path = GetLibAVFormatPath(); name = GetLibAVFormatName(); - wxLogMessage(wxT("mLibAVFormatPath is empty, starting with path '%s', name '%s'."), + wxLogMessage(wxT("mLibAVFormatPath is empty, starting with path '%s', name '%s'."), path.c_str(), name.c_str()); } @@ -781,7 +659,7 @@ mLibAVFormatPath = path; } } - + #if defined(__WXMAC__) // If not successful, try loading it from legacy path if (!mLibsLoaded && !GetLibAVFormatPath().IsEmpty()) { @@ -815,16 +693,16 @@ gPrefs->Read(wxT("/FFmpeg/NotFoundDontShow"),&dontShowDlg,0); if ((dontShowDlg == 0) && (showerr)) { - dlg = new FFmpegNotFoundDialog(NULL); - dlg->ShowModal(); - delete dlg; + dlg = new FFmpegNotFoundDialog(NULL); + dlg->ShowModal(); + delete dlg; } } */ // Oh well, just give up if (!ValidLibsLoaded()) { wxString msg = _("Failed to find compatible FFmpeg libraries."); - if (showerr) + if (showerr) wxMessageBox(msg); wxLogError(msg); return false; @@ -860,7 +738,7 @@ // If the directory, where libavformat is, is not in PATH - add it if (!syspath.Contains(fmtdirsc) && !syspath.Contains(scfmtdir) && !syspath.Contains(fmtdir)) { - wxLogWarning(wxT("FFmpeg directory is not in PATH."), fmtdir.c_str()); + wxLogWarning(wxT("FFmpeg directory '%s' is not in PATH."), fmtdir.c_str()); if (syspath.Last() == wxT(';')) { wxLogMessage(wxT("Temporarily appending '%s' to PATH..."), fmtdir.c_str()); @@ -909,8 +787,8 @@ if (actual.GetFullPath().IsSameAs(name.GetFullPath())) { actual = FileNames::PathFromAddr(avformat->GetSymbol(wxT("avcodec_version"))); if (actual.GetFullPath().IsSameAs(name.GetFullPath())) { - util = avformat; - codec = avformat; + util = avformat; + codec = avformat; } } @@ -977,74 +855,45 @@ wxLogMessage(wxT("Importing symbols...")); FFMPEG_INITDYN(avformat, av_register_all); - FFMPEG_INITDYN(avformat, av_find_stream_info); + FFMPEG_INITDYN(avformat, avformat_find_stream_info); FFMPEG_INITDYN(avformat, av_read_frame); FFMPEG_INITDYN(avformat, av_seek_frame); - FFMPEG_INITDYN(avformat, av_close_input_file); - FFMPEG_INITDYN(avformat, av_write_header); + FFMPEG_INITDYN(avformat, avformat_close_input); + FFMPEG_INITDYN(avformat, avformat_write_header); FFMPEG_INITDYN(avformat, av_interleaved_write_frame); - FFMPEG_INITDYN(avformat, av_iformat_next); FFMPEG_INITDYN(avformat, av_oformat_next); - FFMPEG_INITDYN(avformat, av_set_parameters); - FFMPEG_INITDYN(avformat, url_open_protocol); - FFMPEG_INITDYN(avformat, url_open); - FFMPEG_INITDYN(avformat, url_fdopen); - FFMPEG_INITDYN(avformat, url_close); - FFMPEG_INITDYN(avformat, url_fseek); - FFMPEG_INITDYN(avformat, url_fclose); - FFMPEG_INITDYN(avformat, av_new_stream); + FFMPEG_INITDYN(avformat, avformat_new_stream); FFMPEG_INITDYN(avformat, avformat_alloc_context); FFMPEG_INITDYN(avformat, av_write_trailer); FFMPEG_INITDYN(avformat, av_codec_get_tag); FFMPEG_INITDYN(avformat, avformat_version); - FFMPEG_INITDYN(avformat, av_open_input_stream); - FFMPEG_INITDYN(avformat, av_metadata_get); - - FFMPEG_INITALT(avformat, av_register_protocol2, av_register_protocol); - FFMPEG_INITALT(avformat, avio_read, get_buffer); - FFMPEG_INITALT(avformat, avio_seek, url_fseek); - FFMPEG_INITALT(avformat, avio_close, url_fclose); - FFMPEG_INITALT(avformat, av_metadata_set2, av_metadata_set); + FFMPEG_INITDYN(avformat, avformat_open_input); + FFMPEG_INITDYN(avformat, avio_size); + FFMPEG_INITDYN(avformat, avio_alloc_context); FFMPEG_INITALT(avformat, av_guess_format, guess_format); - FFMPEG_INITALT(avformat, av_match_ext, match_ext); -#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 58, 0) FFMPEG_INITDYN(avcodec, av_init_packet); -#else - FFMPEG_INITDYN(avformat, av_init_packet); -#endif - -#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(52, 31, 0) FFMPEG_INITDYN(avcodec, av_free_packet); -#endif - FFMPEG_INITDYN(avcodec, avcodec_init); FFMPEG_INITDYN(avcodec, avcodec_find_encoder); FFMPEG_INITDYN(avcodec, avcodec_find_encoder_by_name); FFMPEG_INITDYN(avcodec, avcodec_find_decoder); - FFMPEG_INITDYN(avcodec, avcodec_get_context_defaults); - FFMPEG_INITDYN(avcodec, avcodec_open); -#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 25, 0) - FFMPEG_INITDYN(avcodec, avcodec_decode_audio3); -#else - FFMPEG_INITDYN(avcodec, avcodec_decode_audio2); -#endif - FFMPEG_INITDYN(avcodec, avcodec_encode_audio); + FFMPEG_INITDYN(avcodec, avcodec_open2); + FFMPEG_INITDYN(avcodec, avcodec_decode_audio4); + FFMPEG_INITDYN(avcodec, avcodec_encode_audio2); FFMPEG_INITDYN(avcodec, avcodec_close); FFMPEG_INITDYN(avcodec, avcodec_register_all); FFMPEG_INITDYN(avcodec, avcodec_version); - FFMPEG_INITDYN(avcodec, av_fast_realloc); FFMPEG_INITDYN(avcodec, av_codec_next); - - FFMPEG_INITALT(avcodec, av_get_bits_per_sample_format, av_get_bits_per_sample_fmt); + FFMPEG_INITDYN(avcodec, av_codec_is_encoder); + FFMPEG_INITDYN(avcodec, avcodec_fill_audio_frame); FFMPEG_INITDYN(avutil, av_free); + FFMPEG_INITDYN(avutil, av_dict_get); + FFMPEG_INITDYN(avutil, av_dict_set); + FFMPEG_INITDYN(avutil, av_get_bytes_per_sample); FFMPEG_INITDYN(avutil, av_log_set_callback); FFMPEG_INITDYN(avutil, av_log_default_callback); -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) FFMPEG_INITDYN(avutil, av_fifo_alloc); -#else - FFMPEG_INITDYN(avutil, av_fifo_init); -#endif FFMPEG_INITDYN(avutil, av_fifo_generic_read); FFMPEG_INITDYN(avutil, av_fifo_realloc2); FFMPEG_INITDYN(avutil, av_fifo_free); @@ -1054,15 +903,17 @@ FFMPEG_INITDYN(avutil, av_freep); FFMPEG_INITDYN(avutil, av_rescale_q); FFMPEG_INITDYN(avutil, avutil_version); + FFMPEG_INITALT(avutil, av_frame_alloc, avcodec_alloc_frame); + FFMPEG_INITALT(avutil, av_frame_free, avcodec_free_frame); + FFMPEG_INITDYN(avutil, av_samples_get_buffer_size); wxLogMessage(wxT("All symbols loaded successfully. Initializing the library.")); #endif //FFmpeg initialization - avcodec_init(); avcodec_register_all(); av_register_all(); - + wxLogMessage(wxT("Retrieving FFmpeg library version numbers:")); int avfver = avformat_version(); int avcver = avcodec_version(); @@ -1071,14 +922,14 @@ mAVFormatVersion = wxString::Format(wxT("%d.%d.%d"),avfver >> 16 & 0xFF, avfver >> 8 & 0xFF, avfver & 0xFF); mAVUtilVersion = wxString::Format(wxT("%d.%d.%d"),avuver >> 16 & 0xFF, avuver >> 8 & 0xFF, avuver & 0xFF); - wxLogMessage(wxT(" AVCodec version 0x%06x - %s (built against 0x%06x - %s)"), - avcver, mAVCodecVersion.c_str(), LIBAVCODEC_VERSION_INT, + wxLogMessage(wxT(" AVCodec version 0x%06x - %s (built against 0x%06x - %s)"), + avcver, mAVCodecVersion.c_str(), LIBAVCODEC_VERSION_INT, wxString::FromUTF8(AV_STRINGIFY(LIBAVCODEC_VERSION)).c_str()); - wxLogMessage(wxT(" AVFormat version 0x%06x - %s (built against 0x%06x - %s)"), - avfver, mAVFormatVersion.c_str(), LIBAVFORMAT_VERSION_INT, + wxLogMessage(wxT(" AVFormat version 0x%06x - %s (built against 0x%06x - %s)"), + avfver, mAVFormatVersion.c_str(), LIBAVFORMAT_VERSION_INT, wxString::FromUTF8(AV_STRINGIFY(LIBAVFORMAT_VERSION)).c_str()); - wxLogMessage(wxT(" AVUtil version 0x%06x - %s (built against 0x%06x - %s)"), - avuver,mAVUtilVersion.c_str(), LIBAVUTIL_VERSION_INT, + wxLogMessage(wxT(" AVUtil version 0x%06x - %s (built against 0x%06x - %s)"), + avuver,mAVUtilVersion.c_str(), LIBAVUTIL_VERSION_INT, wxString::FromUTF8(AV_STRINGIFY(LIBAVUTIL_VERSION)).c_str()); int avcverdiff = (avcver >> 16 & 0xFF) - int(LIBAVCODEC_VERSION_MAJOR); @@ -1097,12 +948,6 @@ return false; } -#if defined(DISABLE_DYNAMIC_LOADING_FFMPEG) && (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 69, 0)) - av_register_protocol(&ufile_protocol); -#else - av_register_protocol2(&ufile_protocol, sizeof(ufile_protocol)); -#endif - return true; } --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -16,6 +16,10 @@ #if !defined(__AUDACITY_FFMPEG__) #define __AUDACITY_FFMPEG__ +// TODO: Determine whether the libav* headers come from the FFmpeg or libav +// project and set IS_FFMPEG_PROJECT depending on it. +#define IS_FFMPEG_PROJECT 1 + /* FFmpeg is written in C99. It uses many types from stdint.h. Because we are * compiling this using a C++ compiler we have to put it in extern "C". * __STDC_CONSTANT_MACROS is defined to make behave like it @@ -31,7 +35,7 @@ #if defined(USE_FFMPEG) extern "C" { - // Include errno.h before the ffmpeg includes since they depend on + // Include errno.h before the ffmpeg includes since they depend on // knowing the value of EINVAL...see bottom of avcodec.h. Not doing // so will produce positive error returns when they should be < 0. #include @@ -41,28 +45,85 @@ #include #include - #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 102, 0) - #define AVIOContext ByteIOContext - #endif - - #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 94, 1) - #define AVSampleFormat SampleFormat - #endif + #if defined(DISABLE_DYNAMIC_LOADING_FFMPEG) + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 45, 101) + #define av_frame_alloc avcodec_alloc_frame + #define av_frame_free avcodec_free_frame + #endif + + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 59, 100) + inline void avcodec_free_frame(AVFrame **frame) { + av_free(*frame); + } + #endif - #if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 120, 0) - #define CodecType AVMediaType - #define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN - #define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO - #define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO - #define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA - #define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE - #define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT - #define CODEC_TYPE_NB AVMEDIA_TYPE_NB + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 51, 100) + #define AVCodecID CodecID + #define AV_CODEC_ID_AAC CODEC_ID_AAC + #define AV_CODEC_ID_AC CODEC_ID_AC + #define AV_CODEC_ID_AC3 CODEC_ID_AC3 + #define AV_CODEC_ID_ADPCM CODEC_ID_ADPCM + #define AV_CODEC_ID_ADPCM_CT CODEC_ID_ADPCM_CT + #define AV_CODEC_ID_ADPCM_G726 CODEC_ID_ADPCM_G726 + #define AV_CODEC_ID_ADPCM_IMA_QT CODEC_ID_ADPCM_IMA_QT + #define AV_CODEC_ID_ADPCM_IMA_WAV CODEC_ID_ADPCM_IMA_WAV + #define AV_CODEC_ID_ADPCM_MS CODEC_ID_ADPCM_MS + #define AV_CODEC_ID_ADPCM_SWF CODEC_ID_ADPCM_SWF + #define AV_CODEC_ID_ADPCM_YAMAHA CODEC_ID_ADPCM_YAMAHA + #define AV_CODEC_ID_ALAC CODEC_ID_ALAC + #define AV_CODEC_ID_AMR CODEC_ID_AMR + #define AV_CODEC_ID_AMR_NB CODEC_ID_AMR_NB + #define AV_CODEC_ID_AMR_WB CODEC_ID_AMR_WB + #define AV_CODEC_ID_ATRAC CODEC_ID_ATRAC + #define AV_CODEC_ID_ATRAC3 CODEC_ID_ATRAC3 + #define AV_CODEC_ID_DTS CODEC_ID_DTS + #define AV_CODEC_ID_DVAUDIO CODEC_ID_DVAUDIO + #define AV_CODEC_ID_FLAC CODEC_ID_FLAC + #define AV_CODEC_ID_GSM CODEC_ID_GSM + #define AV_CODEC_ID_GSM_MS CODEC_ID_GSM_MS + #define AV_CODEC_ID_IMC CODEC_ID_IMC + #define AV_CODEC_ID_MACE CODEC_ID_MACE + #define AV_CODEC_ID_MACE3 CODEC_ID_MACE3 + #define AV_CODEC_ID_MACE6 CODEC_ID_MACE6 + #define AV_CODEC_ID_MP CODEC_ID_MP + #define AV_CODEC_ID_MP2 CODEC_ID_MP2 + #define AV_CODEC_ID_MP3 CODEC_ID_MP3 + #define AV_CODEC_ID_NELLYMOSER CODEC_ID_NELLYMOSER + #define AV_CODEC_ID_NONE CODEC_ID_NONE + #define AV_CODEC_ID_PCM CODEC_ID_PCM + #define AV_CODEC_ID_PCM_ALAW CODEC_ID_PCM_ALAW + #define AV_CODEC_ID_PCM_MULAW CODEC_ID_PCM_MULAW + #define AV_CODEC_ID_PCM_S16BE CODEC_ID_PCM_S16BE + #define AV_CODEC_ID_PCM_S16LE CODEC_ID_PCM_S16LE + #define AV_CODEC_ID_PCM_S24BE CODEC_ID_PCM_S24BE + #define AV_CODEC_ID_PCM_S24LE CODEC_ID_PCM_S24LE + #define AV_CODEC_ID_PCM_S32BE CODEC_ID_PCM_S32BE + #define AV_CODEC_ID_PCM_S32LE CODEC_ID_PCM_S32LE + #define AV_CODEC_ID_PCM_S8 CODEC_ID_PCM_S8 + #define AV_CODEC_ID_PCM_U8 CODEC_ID_PCM_U8 + #define AV_CODEC_ID_QCELP CODEC_ID_QCELP + #define AV_CODEC_ID_QDM CODEC_ID_QDM + #define AV_CODEC_ID_QDM2 CODEC_ID_QDM2 + #define AV_CODEC_ID_ROQ CODEC_ID_ROQ + #define AV_CODEC_ID_ROQ_DPCM CODEC_ID_ROQ_DPCM + #define AV_CODEC_ID_SONIC CODEC_ID_SONIC + #define AV_CODEC_ID_SONIC_LS CODEC_ID_SONIC_LS + #define AV_CODEC_ID_TRUESPEECH CODEC_ID_TRUESPEECH + #define AV_CODEC_ID_VORBIS CODEC_ID_VORBIS + #define AV_CODEC_ID_VOXWARE CODEC_ID_VOXWARE + #define AV_CODEC_ID_WMAPRO CODEC_ID_WMAPRO + #define AV_CODEC_ID_WMAV CODEC_ID_WMAV + #define AV_CODEC_ID_WMAV1 CODEC_ID_WMAV1 + #define AV_CODEC_ID_WMAV2 CODEC_ID_WMAV2 + #define AV_CODEC_ID_WMAVOICE CODEC_ID_WMAVOICE + #endif + + #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 8, 100) + inline bool av_codec_is_encoder(AVCodec *codec) { + return codec != NULL && (codec->encode != NULL || codec->encode2 != NULL); + } + #endif #endif - - #ifndef PKT_FLAG_KEY - #define PKT_FLAG_KEY AV_PKT_FLAG_KEY - #endif } #endif @@ -71,13 +132,13 @@ * we need for the next bit */ #include #include -#include // for wxLogNull -#include // for wxMessageBox +#include // for wxLogNull +#include // for wxMessageBox #include -#include "../widgets/LinkingHtmlWindow.h" +#include "widgets/LinkingHtmlWindow.h" #include "FileDialog.h" #include "ShuttleGui.h" -#include "../Prefs.h" +#include "Prefs.h" #include #include // needed for sampleCount @@ -310,7 +371,7 @@ wxString mAVCodecVersion; wxString mAVFormatVersion; wxString mAVUtilVersion; - + ///! wx interfaces for dynamic libraries wxDynamicLibrary *avformat; wxDynamicLibrary *avcodec; @@ -331,6 +392,7 @@ int ufile_fopen(AVIOContext **s, const wxString & name, int flags); int ufile_fopen_input(AVFormatContext **ic_ptr, wxString & name); +int ufile_close(AVIOContext *pb); typedef struct _streamContext { @@ -341,7 +403,7 @@ AVPacket m_pkt; // the last AVPacket we read for this stream int m_pktValid; // is m_pkt valid? uint8_t *m_pktDataPtr; // pointer into m_pkt.data - int m_pktRemainingSiz; + int m_pktRemainingSiz; int64_t m_pts; // the current presentation time of the input stream int64_t m_ptsOffset; // packets associated with stream are relative to this @@ -353,7 +415,7 @@ int m_initialchannels; // number of channels allocated when we begin the importing. Assumes that number of channels doesn't change on the fly. int m_samplesize; // input sample size in bytes - SampleFormat m_samplefmt; // input sample format + AVSampleFormat m_samplefmt; // input sample format int m_osamplesize; // output sample size in bytes sampleFormat m_osamplefmt; // output sample format @@ -368,18 +430,7 @@ int import_ffmpeg_decode_frame(streamContext *sc, bool flushing); -#if defined(DISABLE_DYNAMIC_LOADING_FFMPEG) - // Use the preprocessor to rename old function names instead of checking the - // function names with FFMPEG_INITALT when loading the library. - - #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 60, 0) - #define av_match_ext match_ext - #endif - - #if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52, 64, 0) - #define av_guess_format guess_format - #endif -#else +#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) extern "C" { // A little explanation of what's going on here. // @@ -401,7 +452,7 @@ // make sure that the definitions are the same. If not, it will complain. For this to occur, // the functions MUST be defined in an extern "C" block otherwise the compiler just thinks the // functions are being overloaded. - // + // // The compiler should optimize away the inline function since it just passes control to the real // function and we should wind up with about the same function call we had before, only now it is // safer due to the validation. @@ -476,7 +527,7 @@ } \ } - // + // // libavutil // FFMPEG_FUNCTION_WITH_RETURN( @@ -486,7 +537,7 @@ () ); FFMPEG_FUNCTION_NO_RETURN( - av_log_set_callback, + av_log_set_callback, (void (*cb)(void*, int, const char*, va_list)), (cb) ); @@ -510,15 +561,10 @@ (void), () ); - FFMPEG_FUNCTION_NO_RETURN( - avcodec_init, - (void), - () - ); FFMPEG_FUNCTION_WITH_RETURN( AVCodec*, avcodec_find_encoder, - (enum CodecID id), + (enum AVCodecID id), (id) ); FFMPEG_FUNCTION_WITH_RETURN( @@ -530,46 +576,41 @@ FFMPEG_FUNCTION_WITH_RETURN( AVCodec*, avcodec_find_decoder, - (enum CodecID id), + (enum AVCodecID id), (id) ); FFMPEG_FUNCTION_WITH_RETURN( unsigned int, av_codec_get_tag, - (const struct AVCodecTag * const *tags, enum CodecID id), + (const struct AVCodecTag * const *tags, enum AVCodecID id), (tags, id) ); - FFMPEG_FUNCTION_NO_RETURN( - avcodec_get_context_defaults, - (AVCodecContext *s), - (s) - ); FFMPEG_FUNCTION_WITH_RETURN( int, - avcodec_open, - (AVCodecContext *avctx, AVCodec *codec), - (avctx, codec); + avcodec_open2, + (AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options), + (avctx, codec, options); ); -#if LIBAVCODEC_VERSION_INT > AV_VERSION_INT(52, 25, 0) +#if defined(IS_FFMPEG_PROJECT) FFMPEG_FUNCTION_WITH_RETURN( int, - avcodec_decode_audio3, - (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt), - (avctx, samples, frame_size_ptr, avpkt) + avcodec_decode_audio4, + (AVCodecContext *avctx, AVFrame *frame, int *got_output, const AVPacket *avpkt), + (avctx, frame, got_output, avpkt) ); #else FFMPEG_FUNCTION_WITH_RETURN( int, - avcodec_decode_audio2, - (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, const uint8_t *buf, int buf_size), - (avctx, samples, frame_size_ptr, buf, buf_size) + avcodec_decode_audio4, + (AVCodecContext *avctx, AVFrame *frame, int *got_output, AVPacket *avpkt), + (avctx, frame, got_output, avpkt) ); #endif FFMPEG_FUNCTION_WITH_RETURN( int, - avcodec_encode_audio, - (AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples), - (avctx, buf, buf_size, samples) + avcodec_encode_audio2, + (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_output), + (avctx, pkt, frame, got_output) ); FFMPEG_FUNCTION_WITH_RETURN( int, @@ -584,15 +625,15 @@ ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_get_bits_per_sample_format, - (enum SampleFormat sample_fmt), + av_get_bytes_per_sample, + (enum AVSampleFormat sample_fmt), (sample_fmt) ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_get_bits_per_sample_fmt, - (enum AVSampleFormat sample_fmt), - (sample_fmt) + avcodec_fill_audio_frame, + (AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align), + (frame, nb_channels, sample_fmt, buf, buf_size, align) ); // @@ -604,32 +645,11 @@ (void), () ); -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0) - FFMPEG_FUNCTION_WITH_RETURN( - void*, - av_fast_realloc, - (void *ptr, unsigned int *size, unsigned int min_size), - (ptr, size, min_size) - ); -#else - FFMPEG_FUNCTION_WITH_RETURN( - void*, - av_fast_realloc, - (void *ptr, unsigned int *size, size_t min_size), - (ptr, size, min_size) - ); -#endif - FFMPEG_FUNCTION_WITH_RETURN( - int, - av_open_input_stream, - (AVFormatContext **ic_ptr, AVIOContext *pb, const char *filename, AVInputFormat *fmt, AVFormatParameters *ap), - (ic_ptr, pb, filename, fmt, ap) - ); FFMPEG_FUNCTION_WITH_RETURN( int, - get_buffer, - (AVIOContext *s, unsigned char *buf, int size), - (s, buf, size) + avformat_open_input, + (AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, AVDictionary **options), + (ic_ptr, filename, fmt, options) ); FFMPEG_FUNCTION_NO_RETURN( av_register_all, @@ -638,15 +658,9 @@ ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_register_protocol, - (URLProtocol *protocol), - (protocol) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - av_find_stream_info, - (AVFormatContext *ic), - (ic) + avformat_find_stream_info, + (AVFormatContext *ic, AVDictionary **options), + (ic, options) ); FFMPEG_FUNCTION_WITH_RETURN( int, @@ -661,21 +675,15 @@ (s, stream_index, timestamp, flags) ); FFMPEG_FUNCTION_NO_RETURN( - av_close_input_file, - (AVFormatContext *s), + avformat_close_input, + (AVFormatContext **s), (s) ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_write_header, - (AVFormatContext *s), - (s) - ); - FFMPEG_FUNCTION_WITH_RETURN( - AVInputFormat*, - av_iformat_next, - (AVInputFormat *f), - (f) + avformat_write_header, + (AVFormatContext *s, AVDictionary **options), + (s, options) ); FFMPEG_FUNCTION_WITH_RETURN( AVOutputFormat*, @@ -686,69 +694,24 @@ FFMPEG_FUNCTION_WITH_RETURN( AVCodec*, av_codec_next, - (AVCodec *c), + (const AVCodec *c), (c) ); +#if defined(IS_FFMPEG_PROJECT) FFMPEG_FUNCTION_WITH_RETURN( - int, - av_set_parameters, - (AVFormatContext *s, AVFormatParameters *ap), - (s, ap) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_open_protocol, - (URLContext **puc, struct URLProtocol *up, const char *filename, int flags), - (puc, up, filename, flags) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_open, - (URLContext **puc, const char *filename, int flags), - (puc, filename, flags) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_fdopen, - (AVIOContext **s, URLContext *h), - (s, h) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_close, - (URLContext *h), - (h) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_fopen, - (AVIOContext **s, const char *filename, int flags), - (s, filename, flags) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int64_t, - url_fseek, - (AVIOContext *s, int64_t offset, int whence), - (s, offset, whence) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - url_fclose, - (AVIOContext *s), - (s) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int64_t, - url_fsize, - (AVIOContext *s), - (s) + AVStream*, + avformat_new_stream, + (AVFormatContext *s, const AVCodec *c), + (s, c) ); +#else FFMPEG_FUNCTION_WITH_RETURN( AVStream*, - av_new_stream, - (AVFormatContext *s, int id), - (s, id) + avformat_new_stream, + (AVFormatContext *s, AVCodec *c), + (s, c) ); +#endif FFMPEG_FUNCTION_WITH_RETURN( AVFormatContext*, avformat_alloc_context, @@ -763,12 +726,6 @@ ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_match_ext, - (const char *filename, const char *extensions), - (filename, extensions) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, av_write_trailer, (AVFormatContext *s), (s) @@ -801,21 +758,12 @@ (AVFifoBuffer *f), (f) ); -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 0, 0) - FFMPEG_FUNCTION_WITH_RETURN( - void*, - av_malloc, - (unsigned int size), - (size) - ); -#else FFMPEG_FUNCTION_WITH_RETURN( void*, av_malloc, (size_t size), (size) ); -#endif FFMPEG_FUNCTION_NO_RETURN( av_freep, (void *ptr), @@ -827,16 +775,11 @@ (int64_t a, AVRational bq, AVRational cq), (a, bq, cq) ); - -#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(52, 31, 0) FFMPEG_FUNCTION_NO_RETURN( av_free_packet, (AVPacket *pkt), (pkt) ); -#endif - -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) FFMPEG_FUNCTION_WITH_RETURN( AVFifoBuffer*, av_fifo_alloc, @@ -849,20 +792,6 @@ (AVFifoBuffer *f, void *buf, int buf_size, void (*func)(void*, void*, int)), (f, buf, buf_size, func) ); -#else - FFMPEG_FUNCTION_WITH_RETURN( - int, - av_fifo_init, - (AVFifoBuffer *f, unsigned int size), - (f, size) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - av_fifo_generic_read, - (AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest), - (f, buf_size, func, dest) - ); -#endif FFMPEG_FUNCTION_WITH_RETURN( int, av_fifo_realloc2, @@ -870,46 +799,57 @@ (f, size) ); FFMPEG_FUNCTION_WITH_RETURN( - AVMetadataTag *, - av_metadata_get, - (AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags), + AVDictionaryEntry *, + av_dict_get, + (AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags), (m, key, prev, flags) ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_metadata_set, - (AVMetadata **pm, const char *key, const char *value), - (pm, key, value) - ); - FFMPEG_FUNCTION_WITH_RETURN( - int, - av_metadata_set2, - (AVMetadata **pm, const char *key, const char *value, int flags), + av_dict_set, + (AVDictionary **pm, const char *key, const char *value, int flags), (pm, key, value, flags) ); FFMPEG_FUNCTION_WITH_RETURN( - int, - avio_read, - (AVIOContext *s, unsigned char *buf, int size), - (s, buf, size) + int64_t, + avio_size, + (AVIOContext *s), + (s) ); FFMPEG_FUNCTION_WITH_RETURN( - int64_t, - avio_seek, - (AVIOContext *s, int64_t offset, int whence), - (s, offset, whence) + AVIOContext *, + avio_alloc_context, + (unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)), + (buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek) ); FFMPEG_FUNCTION_WITH_RETURN( int, - avio_close, - (AVIOContext *s), - (s) + av_codec_is_encoder, + (const AVCodec *codec), + (codec) + ); + FFMPEG_FUNCTION_WITH_RETURN( + AVFrame*, + av_frame_alloc, + (void), + () + ); + FFMPEG_FUNCTION_NO_RETURN( + av_frame_free, + (AVFrame **frame), + (frame) ); FFMPEG_FUNCTION_WITH_RETURN( int, - av_register_protocol2, - (URLProtocol *protocol, int size), - (protocol, size) + av_samples_get_buffer_size, + (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align), + (linesize, nb_channels, nb_samples, sample_fmt, align) ); }; #endif --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -12,8 +12,8 @@ ******************************************************************//** \class ExportFFmpeg -\brief Controlling class for FFmpeg exporting. Creates the options -dialog of the appropriate type, adds tags and invokes the export +\brief Controlling class for FFmpeg exporting. Creates the options +dialog of the appropriate type, adds tags and invokes the export function. *//*******************************************************************/ @@ -49,6 +49,10 @@ #include "ExportFFmpegDialogs.h" +#if defined(WIN32) +#define snprintf _snprintf +#endif + #if defined(USE_FFMPEG) extern FFmpegLibs *FFmpegLibsInst; @@ -97,14 +101,14 @@ /// Format intialization bool Init(const char *shortname, AudacityProject *project, Tags *metadata, int subformat); - + /// Codec intialization bool InitCodecs(AudacityProject *project); /// Writes metadata bool AddTags(Tags *metadata); - /// Sets individual metadata values + /// Sets individual metadata values void SetMetadata(Tags *tags, const char *name, const wxChar *tag); /// Encodes audio @@ -145,19 +149,14 @@ private: - AVFormatContext * mEncFormatCtx; // libavformat's context for our output file - AVOutputFormat * mEncFormatDesc; // describes our output file to libavformat - - AVStream * mEncAudioStream; // the output audio stream (may remain NULL) - AVCodecContext * mEncAudioCodecCtx; // the encoder for the output audio stream - uint8_t * mEncAudioEncodedBuf; // buffer to hold frames encoded by the encoder - int mEncAudioEncodedBufSiz; - AVFifoBuffer * mEncAudioFifo; // FIFO to write incoming audio samples into - uint8_t * mEncAudioFifoOutBuf; // buffer to read _out_ of the FIFO into - -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 0, 0) - AVFifoBuffer mEncAudioFifoBuffer; // FIFO to write incoming audio samples into -#endif + AVFormatContext * mEncFormatCtx; // libavformat's context for our output file + AVOutputFormat * mEncFormatDesc; // describes our output file to libavformat + int default_frame_size; + AVStream * mEncAudioStream; // the output audio stream (may remain NULL) + AVCodecContext * mEncAudioCodecCtx; // the encoder for the output audio stream + AVFifoBuffer * mEncAudioFifo; // FIFO to write incoming audio samples into + uint8_t * mEncAudioFifoOutBuf; // buffer to read _out_ of the FIFO into + int mEncAudioFifoOutBufSiz; wxString mName; @@ -171,18 +170,13 @@ ExportFFmpeg::ExportFFmpeg() : ExportPlugin() { - mEncFormatCtx = NULL; // libavformat's context for our output file - mEncFormatDesc = NULL; // describes our output file to libavformat - mEncAudioStream = NULL; // the output audio stream (may remain NULL) - mEncAudioCodecCtx = NULL; // the encoder for the output audio stream - mEncAudioEncodedBuf = NULL; // buffer to hold frames encoded by the encoder + mEncFormatCtx = NULL; // libavformat's context for our output file + mEncFormatDesc = NULL; // describes our output file to libavformat + mEncAudioStream = NULL; // the output audio stream (may remain NULL) + mEncAudioCodecCtx = NULL; // the encoder for the output audio stream #define MAX_AUDIO_PACKET_SIZE (128 * 1024) - mEncAudioEncodedBufSiz = 4*MAX_AUDIO_PACKET_SIZE; - mEncAudioFifoOutBuf = NULL; // buffer to read _out_ of the FIFO into - -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50, 0, 0) - mEncAudioFifo = &mEncAudioFifoBuffer; -#endif + mEncAudioFifoOutBuf = NULL; // buffer to read _out_ of the FIFO into + mEncAudioFifoOutBufSiz = 0; mSampleRate = 0; mSupportsUTF8 = true; @@ -265,8 +259,6 @@ av_log_set_callback(av_log_wx_callback); - AVFormatParameters fpOutFile; - // See if libavformat has modules that can write our output format. If so, mEncFormatDesc // will describe the functions used to write the format (used internally by libavformat) // and the default video/audio codecs that the format uses. @@ -286,39 +278,26 @@ // Initialise the output format context. mEncFormatCtx->oformat = mEncFormatDesc; memcpy(mEncFormatCtx->filename, OSINPUT(mName), strlen(OSINPUT(mName))+1); - + // At the moment Audacity can export only one audio stream - if ((mEncAudioStream = av_new_stream(mEncFormatCtx, 1)) == NULL) + if ((mEncAudioStream = avformat_new_stream(mEncFormatCtx, NULL)) == NULL) { wxLogError(wxT("FFmpeg : ERROR - Can't add audio stream to output file \"%s\"."), mName.c_str()); return false; } mEncAudioStream->id = 0; - mEncFormatCtx->timestamp = 0; // Open the output file. if (!(mEncFormatDesc->flags & AVFMT_NOFILE)) { - if ((err = ufile_fopen(&mEncFormatCtx->pb, mName, URL_WRONLY)) < 0) + if ((err = ufile_fopen(&mEncFormatCtx->pb, mName, AVIO_FLAG_WRITE)) < 0) { wxLogError(wxT("FFmpeg : ERROR - Can't open output file \"%s\" to write. Error code is %d."), mName.c_str(),err); return false; } } - // Set default parameters on the format context. - memset(&fpOutFile, 0, sizeof(AVFormatParameters)); - if ((err = av_set_parameters(mEncFormatCtx, &fpOutFile)) < 0) - { - wxLogError(wxT("FFmpeg : ERROR - Can't set output parameters for output file \"%s\". Error code is %d."), mName.c_str(),err); - return false; - } - - // I have no idea what is this - mEncFormatCtx->preload = (int)(0.5 * AV_TIME_BASE); - mEncFormatCtx->max_delay = (int)(0.7 * AV_TIME_BASE); - // Open the audio stream's codec and initialise any stream related data. if (!InitCodecs(project)) return false; @@ -334,7 +313,7 @@ } // Write headers to the output file. - if ((err = av_write_header(mEncFormatCtx)) < 0) + if ((err = avformat_write_header(mEncFormatCtx, NULL)) < 0) { wxLogError(wxT("FFmpeg : ERROR - Can't write headers to output file \"%s\". Error code is %d."), mName.c_str(),err); @@ -352,16 +331,23 @@ return false; } +static int set_dict_int(AVDictionary **dict, const char *key, int val) +{ + char val_str[256]; + snprintf(val_str, sizeof(val_str), "%d", val); + return av_dict_set(dict, key, val_str, 0); +} + bool ExportFFmpeg::InitCodecs(AudacityProject *project) { - AVCodec * codec = NULL; + AVCodec *codec = NULL; + AVDictionary *options = NULL; // Configure the audio stream's codec context. mEncAudioCodecCtx = mEncAudioStream->codec; - - avcodec_get_context_defaults(mEncAudioCodecCtx); + mEncAudioCodecCtx->codec_id = ExportFFmpegOptions::fmts[mSubFormat].codecid; - mEncAudioCodecCtx->codec_type = CODEC_TYPE_AUDIO; + mEncAudioCodecCtx->codec_type = AVMEDIA_TYPE_AUDIO; mEncAudioCodecCtx->codec_tag = av_codec_get_tag((const AVCodecTag **)mEncFormatCtx->oformat->codec_tag,mEncAudioCodecCtx->codec_id); mSampleRate = (int)project->GetRate(); mEncAudioCodecCtx->global_quality = -99999; //quality mode is off by default; @@ -399,10 +385,9 @@ mEncAudioCodecCtx->bit_rate = gPrefs->Read(wxT("/FileFormats/WMABitRate"), 198000); if (!CheckSampleRate(mSampleRate,ExportFFmpegWMAOptions::iWMASampleRates[0], ExportFFmpegWMAOptions::iWMASampleRates[4], &ExportFFmpegWMAOptions::iWMASampleRates[0])) mSampleRate = AskResample(mEncAudioCodecCtx->bit_rate,mSampleRate, ExportFFmpegWMAOptions::iWMASampleRates[0], ExportFFmpegWMAOptions::iWMASampleRates[4], &ExportFFmpegWMAOptions::iWMASampleRates[0]); - mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR | 0x0004; break; case FMT_OTHER: - av_metadata_set2(&mEncAudioStream->metadata, "language", gPrefs->Read(wxT("/FileFormats/FFmpegLanguage"),wxT("")).ToUTF8(), 0); + av_dict_set(&mEncAudioStream->metadata, "language", gPrefs->Read(wxT("/FileFormats/FFmpegLanguage"),wxT("")).ToUTF8(), 0); mEncAudioCodecCtx->sample_rate = gPrefs->Read(wxT("/FileFormats/FFmpegSampleRate"),(long)0); if (mEncAudioCodecCtx->sample_rate != 0) mSampleRate = mEncAudioCodecCtx->sample_rate; mEncAudioCodecCtx->bit_rate = gPrefs->Read(wxT("/FileFormats/FFmpegBitRate"), (long)0); @@ -410,22 +395,24 @@ mEncAudioCodecCtx->global_quality = gPrefs->Read(wxT("/FileFormats/FFmpegQuality"),(long)-99999); mEncAudioCodecCtx->cutoff = gPrefs->Read(wxT("/FileFormats/FFmpegCutOff"),(long)0); mEncAudioCodecCtx->flags2 = 0; - if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) mEncAudioCodecCtx->flags2 |= CODEC_FLAG2_BIT_RESERVOIR; + if (gPrefs->Read(wxT("/FileFormats/FFmpegBitReservoir"),true)) + av_dict_set(&options, "reservoir", "1", 0); if (gPrefs->Read(wxT("/FileFormats/FFmpegVariableBlockLen"),true)) mEncAudioCodecCtx->flags2 |= 0x0004; //WMA only? -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0) - mEncAudioCodecCtx->use_lpc = gPrefs->Read(wxT("/FileFormats/FFmpegUseLPC"),true); -#endif mEncAudioCodecCtx->compression_level = gPrefs->Read(wxT("/FileFormats/FFmpegCompLevel"),-1); mEncAudioCodecCtx->frame_size = gPrefs->Read(wxT("/FileFormats/FFmpegFrameSize"),(long)0); - mEncAudioCodecCtx->lpc_coeff_precision = gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0); - mEncAudioCodecCtx->min_prediction_order = gPrefs->Read(wxT("/FileFormats/FFmpegMinPredOrder"),(long)-1); - mEncAudioCodecCtx->max_prediction_order = gPrefs->Read(wxT("/FileFormats/FFmpegMaxPredOrder"),(long)-1); - mEncAudioCodecCtx->min_partition_order = gPrefs->Read(wxT("/FileFormats/FFmpegMinPartOrder"),(long)-1); - mEncAudioCodecCtx->max_partition_order = gPrefs->Read(wxT("/FileFormats/FFmpegMaxPartOrder"),(long)-1); - mEncAudioCodecCtx->prediction_order_method = gPrefs->Read(wxT("/FileFormats/FFmpegPredOrderMethod"),(long)0); - mEncFormatCtx->mux_rate = gPrefs->Read(wxT("/FileFormats/FFmpegMuxRate"),(long)0); + +//FIXME The list of supported options for the seleced encoder should be extracted instead of a few hardcoded + set_dict_int(&options, "lpc_coeff_precision", gPrefs->Read(wxT("/FileFormats/FFmpegLPCCoefPrec"),(long)0)); + set_dict_int(&options, "min_prediction_order", gPrefs->Read(wxT("/FileFormats/FFmpegMinPredOrder"),(long)-1)); + set_dict_int(&options, "max_prediction_order", gPrefs->Read(wxT("/FileFormats/FFmpegMaxPredOrder"),(long)-1)); + set_dict_int(&options, "min_partition_order", gPrefs->Read(wxT("/FileFormats/FFmpegMinPartOrder"),(long)-1)); + set_dict_int(&options, "max_partition_order", gPrefs->Read(wxT("/FileFormats/FFmpegMaxPartOrder"),(long)-1)); + set_dict_int(&options, "prediction_order_method", gPrefs->Read(wxT("/FileFormats/FFmpegPredOrderMethod"),(long)0)); + set_dict_int(&options, "muxrate", gPrefs->Read(wxT("/FileFormats/FFmpegMuxRate"),(long)0)); mEncFormatCtx->packet_size = gPrefs->Read(wxT("/FileFormats/FFmpegPacketSize"),(long)0); - mEncAudioCodecCtx->codec_id = (CodecID)gPrefs->Read(wxT("/FileFormats/FFmpegCodec"), mEncFormatDesc->audio_codec); + codec = avcodec_find_encoder_by_name(gPrefs->Read(wxT("/FileFormats/FFmpegCodec")).ToUTF8()); + if (!codec) + mEncAudioCodecCtx->codec_id = mEncFormatDesc->audio_codec; break; default: return false; @@ -438,16 +425,16 @@ { mEncAudioCodecCtx->flags |= CODEC_FLAG_QSCALE; } - else mEncAudioCodecCtx->global_quality = -99999; - this->mEncAudioStream->quality = mEncAudioCodecCtx->global_quality = mEncAudioCodecCtx->global_quality * FF_QP2LAMBDA; + else mEncAudioCodecCtx->global_quality = 0; + mEncAudioCodecCtx->global_quality = mEncAudioCodecCtx->global_quality * FF_QP2LAMBDA; mEncAudioCodecCtx->sample_rate = mSampleRate; mEncAudioCodecCtx->channels = mChannels; mEncAudioCodecCtx->time_base.num = 1; mEncAudioCodecCtx->time_base.den = mEncAudioCodecCtx->sample_rate; - mEncAudioCodecCtx->sample_fmt = SAMPLE_FMT_S16; - //mEncAudioCodecCtx->strict_std_compliance = FF_COMPLIANCE_STRICT; + mEncAudioCodecCtx->sample_fmt = AV_SAMPLE_FMT_S16; + mEncAudioCodecCtx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; - if (mEncAudioCodecCtx->codec_id == CODEC_ID_AC3) + if (mEncAudioCodecCtx->codec_id == AV_CODEC_ID_AC3) { // As of Jan 4, 2011, the default AC3 encoder only accept SAMPLE_FMT_FLT samples. // But, currently, Audacity only supports SAMPLE_FMT_S16. So, for now, look for the @@ -469,6 +456,25 @@ return false; } + if (codec->sample_fmts) { + for (int i=0; codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { + enum AVSampleFormat fmt = codec->sample_fmts[i]; + if ( fmt == AV_SAMPLE_FMT_U8 + || fmt == AV_SAMPLE_FMT_U8P + || fmt == AV_SAMPLE_FMT_S16 + || fmt == AV_SAMPLE_FMT_S16P + || fmt == AV_SAMPLE_FMT_S32 + || fmt == AV_SAMPLE_FMT_S32P + || fmt == AV_SAMPLE_FMT_FLT + || fmt == AV_SAMPLE_FMT_FLTP) { + mEncAudioCodecCtx->sample_fmt = fmt; + } + if ( fmt == AV_SAMPLE_FMT_S16 + || fmt == AV_SAMPLE_FMT_S16P) + break; + } + } + if (mEncFormatCtx->oformat->flags & AVFMT_GLOBALHEADER) { mEncAudioCodecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER; @@ -476,36 +482,26 @@ } // Open the codec. - if (avcodec_open(mEncAudioCodecCtx, codec) < 0 || mEncAudioCodecCtx->frame_size == 0) + if (avcodec_open2(mEncAudioCodecCtx, codec, &options) < 0) { wxLogError(wxT("FFmpeg : ERROR - Can't open audio codec 0x%x."),mEncAudioCodecCtx->codec_id); return false; } - - wxLogDebug(wxT("FFmpeg : Audio Output Codec Frame Size: %d samples."), mEncAudioCodecCtx->frame_size); - if ((mEncAudioCodecCtx->codec_id >= CODEC_ID_PCM_S16LE) && (mEncAudioCodecCtx->codec_id <= CODEC_ID_PCM_DVD)) - { - mEncAudioEncodedBufSiz = FF_MIN_BUFFER_SIZE; - } - // Allocate a buffer for the encoder to store encoded audio frames into. - if ((mEncAudioEncodedBuf = (uint8_t*)av_malloc(mEncAudioEncodedBufSiz)) == NULL) - { - wxLogError(wxT("FFmpeg : ERROR - Can't allocate buffer to hold encoded audio.")); - return false; - } + default_frame_size = mEncAudioCodecCtx->frame_size; + if (default_frame_size == 0) + default_frame_size = 1024; // arbitrary non zero value; + + wxLogDebug(wxT("FFmpeg : Audio Output Codec Frame Size: %d samples."), mEncAudioCodecCtx->frame_size); // The encoder may require a minimum number of raw audio samples for each encoding but we can't - // guarantee we'll get this minimum each time an audio frame is decoded from the input file so + // guarantee we'll get this minimum each time an audio frame is decoded from the input file so // we use a FIFO to store up incoming raw samples until we have enough for one call to the codec. -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) mEncAudioFifo = av_fifo_alloc(1024); -#else - av_fifo_init(mEncAudioFifo, 1024); -#endif + mEncAudioFifoOutBufSiz = 2*MAX_AUDIO_PACKET_SIZE; // Allocate a buffer to read OUT of the FIFO into. The FIFO maintains its own buffer internally. - if ((mEncAudioFifoOutBuf = (uint8_t*)av_malloc(2*MAX_AUDIO_PACKET_SIZE)) == NULL) + if ((mEncAudioFifoOutBuf = (uint8_t*)av_malloc(mEncAudioFifoOutBufSiz)) == NULL) { wxLogError(wxT("FFmpeg : ERROR - Can't allocate buffer to read into from audio FIFO.")); return false; @@ -514,6 +510,92 @@ return true; } +static int encode_audio(AVCodecContext *avctx, AVPacket *pkt, int16_t *audio_samples, int nb_samples) +{ + int i, ch, buffer_size, ret, got_output = 0; + void *samples = NULL; + AVFrame *frame = NULL; + + if (audio_samples) { + frame = av_frame_alloc(); + if (!frame) + return AVERROR(ENOMEM); + + frame->nb_samples = nb_samples; + frame->format = avctx->sample_fmt; +#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) || (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 13, 0)) + frame->channel_layout = avctx->channel_layout; +#endif + + buffer_size = av_samples_get_buffer_size(NULL, avctx->channels, frame->nb_samples, + avctx->sample_fmt, 0); + if (buffer_size < 0) { + wxLogError(wxT("FFmpeg : ERROR - Could not get sample buffer siz")); + return buffer_size; + } + samples = av_malloc(buffer_size); + if (!samples) { + wxLogError(wxT("FFmpeg : ERROR - Could not allocate bytes for samples buffer")); + return AVERROR(ENOMEM); + } + /* setup the data pointers in the AVFrame */ + ret = avcodec_fill_audio_frame(frame, avctx->channels, avctx->sample_fmt, + (const uint8_t*)samples, buffer_size, 0); + if (ret < 0) { + wxLogError(wxT("FFmpeg : ERROR - Could not setup audio frame")); + return ret; + } + + for (ch = 0; ch < avctx->channels; ch++) { + for (i = 0; i < frame->nb_samples; i++) { + switch(avctx->sample_fmt) { + case AV_SAMPLE_FMT_U8: + ((uint8_t*)(frame->data[0]))[ch + i*avctx->channels] = audio_samples[ch + i*avctx->channels]/258 + 128; + break; + case AV_SAMPLE_FMT_U8P: + ((uint8_t*)(frame->data[ch]))[i] = audio_samples[ch + i*avctx->channels]/258 + 128; + break; + case AV_SAMPLE_FMT_S16: + ((int16_t*)(frame->data[0]))[ch + i*avctx->channels] = audio_samples[ch + i*avctx->channels]; + break; + case AV_SAMPLE_FMT_S16P: + ((int16_t*)(frame->data[ch]))[i] = audio_samples[ch + i*avctx->channels]; + break; + case AV_SAMPLE_FMT_S32: + ((int32_t*)(frame->data[0]))[ch + i*avctx->channels] = audio_samples[ch + i*avctx->channels]<<16; + break; + case AV_SAMPLE_FMT_S32P: + ((int32_t*)(frame->data[ch]))[i] = audio_samples[ch + i*avctx->channels]<<16; + break; + case AV_SAMPLE_FMT_FLT: + ((float*)(frame->data[0]))[ch + i*avctx->channels] = audio_samples[ch + i*avctx->channels] / 32767.0; + break; + case AV_SAMPLE_FMT_FLTP: + ((float*)(frame->data[ch]))[i] = audio_samples[ch + i*avctx->channels] / 32767.; + break; + } + } + } + } + av_init_packet(pkt); + pkt->data = NULL; // packet data will be allocated by the encoder + pkt->size = 0; + + ret = avcodec_encode_audio2(avctx, pkt, frame, &got_output); + if (ret < 0) { + wxLogError(wxT("FFmpeg : ERROR - encoding frame failed")); + return ret; + } + + pkt->dts = pkt->pts = AV_NOPTS_VALUE; // we dont set frame.pts thus dont trust the AVPacket ts + + av_frame_free(&frame); + av_freep(&samples); + + return got_output; +} + + bool ExportFFmpeg::Finalize() { int i, nEncodedBytes; @@ -521,85 +603,78 @@ // Flush the audio FIFO and encoder. for (;;) { - AVPacket pkt; - int nFifoBytes = av_fifo_size(mEncAudioFifo); // any bytes left in audio FIFO? + AVPacket pkt; + int nFifoBytes = av_fifo_size(mEncAudioFifo); // any bytes left in audio FIFO? + + av_init_packet(&pkt); nEncodedBytes = 0; - int nAudioFrameSizeOut = mEncAudioCodecCtx->frame_size * mEncAudioCodecCtx->channels * sizeof(int16_t); - if (mEncAudioCodecCtx->frame_size == 1) nAudioFrameSizeOut = mEncAudioEncodedBufSiz; + int nAudioFrameSizeOut = default_frame_size * mEncAudioCodecCtx->channels * sizeof(int16_t); + + if (nAudioFrameSizeOut > mEncAudioFifoOutBufSiz || nFifoBytes > mEncAudioFifoOutBufSiz) { + wxLogError(wxT("FFmpeg : ERROR - Too much remaining data.")); + return false; + } // Flush the audio FIFO first if necessary. It won't contain a _full_ audio frame because - // if it did we'd have pulled it from the FIFO during the last encodeAudioFrame() call - + // if it did we'd have pulled it from the FIFO during the last encodeAudioFrame() call - // the encoder must support short/incomplete frames for this to work. if (nFifoBytes > 0) { // Fill audio buffer with zeroes. If codec tries to read the whole buffer, // it will just read silence. If not - who cares? - memset(mEncAudioFifoOutBuf,0,nAudioFrameSizeOut); - AVCodec *codec = mEncAudioCodecCtx->codec; + memset(mEncAudioFifoOutBuf,0,mEncAudioFifoOutBufSiz); + const AVCodec *codec = mEncAudioCodecCtx->codec; // We have an incomplete buffer of samples left. Is it OK to encode it? // If codec supports CODEC_CAP_SMALL_LAST_FRAME, we can feed it with smaller frame // Or if codec is FLAC, feed it anyway (it doesn't have CODEC_CAP_SMALL_LAST_FRAME, but it works) // Or if frame_size is 1, then it's some kind of PCM codec, they don't have frames and will be fine with the samples // Or if user configured the exporter to pad with silence, then we'll send audio + silence as a frame. - if ((codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) - || codec->id == CODEC_ID_FLAC - || mEncAudioCodecCtx->frame_size == 1 + if ((codec->capabilities & (CODEC_CAP_SMALL_LAST_FRAME|CODEC_CAP_VARIABLE_FRAME_SIZE)) + || mEncAudioCodecCtx->frame_size <= 1 || gPrefs->Read(wxT("/FileFormats/OverrideSmallLastFrame"), true) ) { - int nFrameSizeTmp = mEncAudioCodecCtx->frame_size; + int frame_size = default_frame_size; // The last frame is going to contain a smaller than usual number of samples. // For codecs without CODEC_CAP_SMALL_LAST_FRAME use normal frame size - if (mEncAudioCodecCtx->frame_size != 1 && codec->capabilities & CODEC_CAP_SMALL_LAST_FRAME) - mEncAudioCodecCtx->frame_size = nFifoBytes / (mEncAudioCodecCtx->channels * sizeof(int16_t)); + if (codec->capabilities & (CODEC_CAP_SMALL_LAST_FRAME|CODEC_CAP_VARIABLE_FRAME_SIZE)) + frame_size = nFifoBytes / (mEncAudioCodecCtx->channels * sizeof(int16_t)); - wxLogDebug(wxT("FFmpeg : Audio FIFO still contains %d bytes, writing %d sample frame ..."), - nFifoBytes, mEncAudioCodecCtx->frame_size); + wxLogDebug(wxT("FFmpeg : Audio FIFO still contains %d bytes, writing %d sample frame ..."), + nFifoBytes, frame_size); // Pull the bytes out from the FIFO and feed them to the encoder. -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) if (av_fifo_generic_read(mEncAudioFifo, mEncAudioFifoOutBuf, nFifoBytes, NULL) == 0) -#else - if (av_fifo_generic_read(mEncAudioFifo, nFifoBytes, NULL, mEncAudioFifoOutBuf) == 0) -#endif { - if (mEncAudioCodecCtx->frame_size != 1) - nEncodedBytes = avcodec_encode_audio(mEncAudioCodecCtx, mEncAudioEncodedBuf, mEncAudioEncodedBufSiz, (int16_t*)mEncAudioFifoOutBuf); - else - nEncodedBytes = avcodec_encode_audio(mEncAudioCodecCtx, mEncAudioEncodedBuf, nFifoBytes, (int16_t*)mEncAudioFifoOutBuf); + nEncodedBytes = encode_audio(mEncAudioCodecCtx, &pkt, (int16_t*)mEncAudioFifoOutBuf, frame_size); } - - mEncAudioCodecCtx->frame_size = nFrameSizeTmp; // restore the native frame size } } // Now flush the encoder. if (nEncodedBytes <= 0) - nEncodedBytes = avcodec_encode_audio(mEncAudioCodecCtx, mEncAudioEncodedBuf, mEncAudioEncodedBufSiz, NULL); + nEncodedBytes = encode_audio(mEncAudioCodecCtx, &pkt, NULL, 0); - if (nEncodedBytes <= 0) + if (nEncodedBytes <= 0) break; - // Okay, we got a final encoded frame we can write to the output file. - av_init_packet(&pkt); - pkt.stream_index = mEncAudioStream->index; - pkt.data = mEncAudioEncodedBuf; - pkt.size = nEncodedBytes; - pkt.flags |= PKT_FLAG_KEY; // Set presentation time of frame (currently in the codec's timebase) in the stream timebase. - if(mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE)) - pkt.pts = av_rescale_q(mEncAudioCodecCtx->coded_frame->pts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); + if(pkt.pts != int64_t(AV_NOPTS_VALUE)) + pkt.pts = av_rescale_q(pkt.pts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); + if(pkt.dts != int64_t(AV_NOPTS_VALUE)) + pkt.dts = av_rescale_q(pkt.dts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); if (av_interleaved_write_frame(mEncFormatCtx, &pkt) != 0) { wxLogError(wxT("FFmpeg : ERROR - Couldn't write last audio frame to output file.")); break; } + av_free_packet(&pkt); } // Write any file trailers. @@ -617,34 +692,28 @@ // Close the output file if we created it. if (!(mEncFormatDesc->flags & AVFMT_NOFILE)) - avio_close(mEncFormatCtx->pb); + ufile_close(mEncFormatCtx->pb); // Free any buffers or structures we allocated. av_free(mEncFormatCtx); - if (mEncAudioEncodedBuf != NULL) - av_free(mEncAudioEncodedBuf); - - if (mEncAudioFifoOutBuf != NULL) - av_free(mEncAudioFifoOutBuf); + av_freep(&mEncAudioFifoOutBuf); + mEncAudioFifoOutBufSiz = 0; av_fifo_free(mEncAudioFifo); -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) mEncAudioFifo = NULL; -#endif return true; } bool ExportFFmpeg::EncodeAudioFrame(int16_t *pFrame, int frameSize) { - AVPacket pkt; - int nBytesToWrite = 0; - uint8_t * pRawSamples = NULL; - int nAudioFrameSizeOut = mEncAudioCodecCtx->frame_size * mEncAudioCodecCtx->channels * sizeof(int16_t); - if (mEncAudioCodecCtx->frame_size == 1) nAudioFrameSizeOut = mEncAudioEncodedBufSiz; - int ret; + AVPacket pkt; + int nBytesToWrite = 0; + uint8_t *pRawSamples = NULL; + int nAudioFrameSizeOut = default_frame_size * mEncAudioCodecCtx->channels * sizeof(int16_t); + int ret; nBytesToWrite = frameSize; pRawSamples = (uint8_t*)pFrame; @@ -655,42 +724,46 @@ wxASSERT(ret == nBytesToWrite); + if (nAudioFrameSizeOut > mEncAudioFifoOutBufSiz) { + wxLogError(wxT("FFmpeg : ERROR - nAudioFrameSizeOut too large.")); + return false; + } + // Read raw audio samples out of the FIFO in nAudioFrameSizeOut byte-sized groups to encode. while ((ret = av_fifo_size(mEncAudioFifo)) >= nAudioFrameSizeOut) { -#if LIBAVUTIL_VERSION_INT > AV_VERSION_INT(49, 15, 0) ret = av_fifo_generic_read(mEncAudioFifo, mEncAudioFifoOutBuf, nAudioFrameSizeOut, NULL); -#else - ret = av_fifo_generic_read(mEncAudioFifo, nAudioFrameSizeOut, NULL, mEncAudioFifoOutBuf); -#endif av_init_packet(&pkt); - pkt.size = avcodec_encode_audio(mEncAudioCodecCtx, - mEncAudioEncodedBuf, mEncAudioEncodedBufSiz, // out - (int16_t*)mEncAudioFifoOutBuf); // in - if (mEncAudioCodecCtx->frame_size == 1) { wxASSERT(pkt.size == mEncAudioEncodedBufSiz); } - if (pkt.size < 0) + int ret= encode_audio(mEncAudioCodecCtx, + &pkt, // out + (int16_t*)mEncAudioFifoOutBuf, // in + default_frame_size); + if (ret < 0) { wxLogError(wxT("FFmpeg : ERROR - Can't encode audio frame.")); return false; } + if (ret == 0) + continue; // Rescale from the codec time_base to the AVStream time_base. - if (mEncAudioCodecCtx->coded_frame && mEncAudioCodecCtx->coded_frame->pts != int64_t(AV_NOPTS_VALUE)) - pkt.pts = av_rescale_q(mEncAudioCodecCtx->coded_frame->pts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); + if (pkt.pts != int64_t(AV_NOPTS_VALUE)) + pkt.pts = av_rescale_q(pkt.pts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); + if (pkt.dts != int64_t(AV_NOPTS_VALUE)) + pkt.dts = av_rescale_q(pkt.dts, mEncAudioCodecCtx->time_base, mEncAudioStream->time_base); //wxLogDebug(wxT("FFmpeg : (%d) Writing audio frame with PTS: %lld."), mEncAudioCodecCtx->frame_number, pkt.pts); pkt.stream_index = mEncAudioStream->index; - pkt.data = mEncAudioEncodedBuf; - pkt.flags |= PKT_FLAG_KEY; // Write the encoded audio frame to the output file. - if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) != 0) + if ((ret = av_interleaved_write_frame(mEncFormatCtx, &pkt)) < 0) { wxLogError(wxT("FFmpeg : ERROR - Failed to write audio frame to file.")); return false; } + av_free_packet(&pkt); } return true; } @@ -710,9 +783,9 @@ wxLogError(wxT("Attempted to export %d channels, but max. channels = %d"),channels,ExportFFmpegOptions::fmts[mSubFormat].maxchannels); wxMessageBox( wxString::Format( - _("Attempted to export %d channels, but maximum number of channels for selected output format is %d"), - channels, - ExportFFmpegOptions::fmts[mSubFormat].maxchannels), + _("Attempted to export %d channels, but maximum number of channels for selected output format is %d"), + channels, + ExportFFmpegOptions::fmts[mSubFormat].maxchannels), _("Error")); return false; } @@ -721,7 +794,7 @@ bool ret = true; if (mSubFormat >= FMT_LAST) return false; - + wxString shortname(ExportFFmpegOptions::fmts[mSubFormat].shortname); if (mSubFormat == FMT_OTHER) shortname = gPrefs->Read(wxT("/FileFormats/FFmpegFormat"),wxT("matroska")); @@ -805,7 +878,7 @@ { wxString value = tags->GetTag(tag); - av_metadata_set2(&mEncFormatCtx->metadata, name, mSupportsUTF8 ? value.ToUTF8() : value.mb_str(), 0); + av_dict_set(&mEncFormatCtx->metadata, name, mSupportsUTF8 ? value.ToUTF8() : value.mb_str(), 0); } } --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -163,8 +163,8 @@ PopulateOrExchange(S); } -/// -/// +/// +/// void ExportFFmpegAC3Options::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND, 0); @@ -173,7 +173,7 @@ { S.StartTwoColumn(); { - S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/AC3BitRate"), + S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/AC3BitRate"), 160000, mBitRateNames, mBitRateLabels); } S.EndTwoColumn(); @@ -192,8 +192,8 @@ return; } -/// -/// +/// +/// void ExportFFmpegAC3Options::OnOK(wxCommandEvent& WXUNUSED(event)) { ShuttleGui S(this, eIsSavingToPrefs); @@ -221,8 +221,8 @@ PopulateOrExchange(S); } -/// -/// +/// +/// void ExportFFmpegAACOptions::PopulateOrExchange(ShuttleGui & S) { S.StartStatic(_("AAC Export Setup"), 1); @@ -245,8 +245,8 @@ return; } -/// -/// +/// +/// void ExportFFmpegAACOptions::OnOK(wxCommandEvent& WXUNUSED(event)) { ShuttleGui S(this, eIsSavingToPrefs); @@ -286,8 +286,8 @@ PopulateOrExchange(S); } -/// -/// +/// +/// void ExportFFmpegAMRNBOptions::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND, 0); @@ -296,7 +296,7 @@ { S.StartTwoColumn(); { - S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/AMRNBBitRate"), + S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/AMRNBBitRate"), 12200, mBitRateNames, mBitRateLabels); } S.EndTwoColumn(); @@ -315,8 +315,8 @@ return; } -/// -/// +/// +/// void ExportFFmpegAMRNBOptions::OnOK(wxCommandEvent& WXUNUSED(event)) { ShuttleGui S(this, eIsSavingToPrefs); @@ -358,8 +358,8 @@ PopulateOrExchange(S); } -/// -/// +/// +/// void ExportFFmpegWMAOptions::PopulateOrExchange(ShuttleGui & S) { S.StartHorizontalLay(wxEXPAND, 0); @@ -368,7 +368,7 @@ { S.StartTwoColumn(); { - S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/WMABitRate"), + S.TieChoice(_("Bit Rate:"), wxT("/FileFormats/WMABitRate"), 96000, mBitRateNames, mBitRateLabels); } S.EndTwoColumn(); @@ -387,8 +387,8 @@ return; } -/// -/// +/// +/// void ExportFFmpegWMAOptions::OnOK(wxCommandEvent& WXUNUSED(event)) { ShuttleGui S(this, eIsSavingToPrefs); @@ -458,7 +458,7 @@ { FFmpegPreset *preset = *iter; list->Add(*preset->mPresetName); - } + } return list; } @@ -542,7 +542,7 @@ // Spin control case FEBitrateID: case FEQualityID: - case FESampleRateID: + case FESampleRateID: case FECutoffID: case FEFrameSizeID: case FEBufSizeID: @@ -625,7 +625,7 @@ case FELPCCoeffsID: case FEMinPredID: case FEMaxPredID: - case FEMinPartOrderID: + case FEMinPartOrderID: case FEMaxPartOrderID: case FEMuxRateID: case FEPacketSizeID: @@ -793,302 +793,292 @@ /// Format-codec compatibility list /// Must end with NULL entry -CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] = +CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] = { - { wxT("adts"), CODEC_ID_AAC }, + { wxT("adts"), AV_CODEC_ID_AAC }, - { wxT("aiff"), CODEC_ID_PCM_S16BE }, - { wxT("aiff"), CODEC_ID_PCM_S8 }, - { wxT("aiff"), CODEC_ID_PCM_S24BE }, - { wxT("aiff"), CODEC_ID_PCM_S32BE }, - { wxT("aiff"), CODEC_ID_PCM_ALAW }, - { wxT("aiff"), CODEC_ID_PCM_MULAW }, - { wxT("aiff"), CODEC_ID_MACE3 }, - { wxT("aiff"), CODEC_ID_MACE6 }, - { wxT("aiff"), CODEC_ID_GSM }, - { wxT("aiff"), CODEC_ID_ADPCM_G726 }, - { wxT("aiff"), CODEC_ID_PCM_S16LE }, - { wxT("aiff"), CODEC_ID_ADPCM_IMA_QT }, - { wxT("aiff"), CODEC_ID_QDM2 }, - - { wxT("amr"), CODEC_ID_AMR_NB }, - { wxT("amr"), CODEC_ID_AMR_WB }, - - { wxT("asf"), CODEC_ID_PCM_S16LE }, - { wxT("asf"), CODEC_ID_PCM_U8 }, - { wxT("asf"), CODEC_ID_PCM_S24LE }, - { wxT("asf"), CODEC_ID_PCM_S32LE }, - { wxT("asf"), CODEC_ID_ADPCM_MS }, - { wxT("asf"), CODEC_ID_PCM_ALAW }, - { wxT("asf"), CODEC_ID_PCM_MULAW }, - { wxT("asf"), CODEC_ID_WMAVOICE }, - { wxT("asf"), CODEC_ID_ADPCM_IMA_WAV }, - { wxT("asf"), CODEC_ID_ADPCM_YAMAHA }, - { wxT("asf"), CODEC_ID_TRUESPEECH }, - { wxT("asf"), CODEC_ID_GSM_MS }, - { wxT("asf"), CODEC_ID_ADPCM_G726 }, - { wxT("asf"), CODEC_ID_MP2 }, - { wxT("asf"), CODEC_ID_MP3 }, - { wxT("asf"), CODEC_ID_VOXWARE }, - { wxT("asf"), CODEC_ID_AAC }, - { wxT("asf"), CODEC_ID_WMAV1 }, - { wxT("asf"), CODEC_ID_WMAV2 }, - { wxT("asf"), CODEC_ID_WMAPRO }, - { wxT("asf"), CODEC_ID_ADPCM_CT }, - { wxT("asf"), CODEC_ID_ATRAC3 }, - { wxT("asf"), CODEC_ID_IMC }, - { wxT("asf"), CODEC_ID_AC3 }, - { wxT("asf"), CODEC_ID_DTS }, - { wxT("asf"), CODEC_ID_SONIC }, - { wxT("asf"), CODEC_ID_SONIC_LS }, - { wxT("asf"), CODEC_ID_FLAC }, - { wxT("asf"), CODEC_ID_ADPCM_SWF }, - { wxT("asf"), CODEC_ID_VORBIS }, - - { wxT("au"), CODEC_ID_PCM_MULAW }, - { wxT("au"), CODEC_ID_PCM_S8 }, - { wxT("au"), CODEC_ID_PCM_S16BE }, - { wxT("au"), CODEC_ID_PCM_ALAW }, - - { wxT("avi"), CODEC_ID_PCM_S16LE }, - { wxT("avi"), CODEC_ID_PCM_U8 }, - { wxT("avi"), CODEC_ID_PCM_S24LE }, - { wxT("avi"), CODEC_ID_PCM_S32LE }, - { wxT("avi"), CODEC_ID_ADPCM_MS }, - { wxT("avi"), CODEC_ID_PCM_ALAW }, - { wxT("avi"), CODEC_ID_PCM_MULAW }, - { wxT("avi"), CODEC_ID_WMAVOICE }, - { wxT("avi"), CODEC_ID_ADPCM_IMA_WAV }, - { wxT("avi"), CODEC_ID_ADPCM_YAMAHA }, - { wxT("avi"), CODEC_ID_TRUESPEECH }, - { wxT("avi"), CODEC_ID_GSM_MS }, - { wxT("avi"), CODEC_ID_ADPCM_G726 }, - { wxT("avi"), CODEC_ID_MP2 }, - { wxT("avi"), CODEC_ID_MP3 }, - { wxT("avi"), CODEC_ID_VOXWARE }, - { wxT("avi"), CODEC_ID_AAC }, - { wxT("avi"), CODEC_ID_WMAV1 }, - { wxT("avi"), CODEC_ID_WMAV2 }, - { wxT("avi"), CODEC_ID_WMAPRO }, - { wxT("avi"), CODEC_ID_ADPCM_CT }, - { wxT("avi"), CODEC_ID_ATRAC3 }, - { wxT("avi"), CODEC_ID_IMC }, - { wxT("avi"), CODEC_ID_AC3 }, - { wxT("avi"), CODEC_ID_DTS }, - { wxT("avi"), CODEC_ID_SONIC }, - { wxT("avi"), CODEC_ID_SONIC_LS }, - { wxT("avi"), CODEC_ID_FLAC }, - { wxT("avi"), CODEC_ID_ADPCM_SWF }, - { wxT("avi"), CODEC_ID_VORBIS }, - - { wxT("crc"), CODEC_ID_NONE }, - - { wxT("dv"), CODEC_ID_PCM_S16LE }, - - { wxT("ffm"), CODEC_ID_NONE }, - - { wxT("flv"), CODEC_ID_MP3 }, - { wxT("flv"), CODEC_ID_PCM_S8 }, - { wxT("flv"), CODEC_ID_PCM_S16BE }, - { wxT("flv"), CODEC_ID_PCM_S16LE }, - { wxT("flv"), CODEC_ID_ADPCM_SWF }, - { wxT("flv"), CODEC_ID_AAC }, - { wxT("flv"), CODEC_ID_NELLYMOSER }, - - { wxT("framecrc"), CODEC_ID_NONE }, - - { wxT("gxf"), CODEC_ID_PCM_S16LE }, - - { wxT("matroska"), CODEC_ID_PCM_S16LE }, - { wxT("matroska"), CODEC_ID_PCM_U8 }, - { wxT("matroska"), CODEC_ID_PCM_S24LE }, - { wxT("matroska"), CODEC_ID_PCM_S32LE }, - { wxT("matroska"), CODEC_ID_ADPCM_MS }, - { wxT("matroska"), CODEC_ID_PCM_ALAW }, - { wxT("matroska"), CODEC_ID_PCM_MULAW }, - { wxT("matroska"), CODEC_ID_WMAVOICE }, - { wxT("matroska"), CODEC_ID_ADPCM_IMA_WAV }, - { wxT("matroska"), CODEC_ID_ADPCM_YAMAHA }, - { wxT("matroska"), CODEC_ID_TRUESPEECH }, - { wxT("matroska"), CODEC_ID_GSM_MS }, - { wxT("matroska"), CODEC_ID_ADPCM_G726 }, - { wxT("matroska"), CODEC_ID_MP2 }, - { wxT("matroska"), CODEC_ID_MP3 }, - { wxT("matroska"), CODEC_ID_VOXWARE }, - { wxT("matroska"), CODEC_ID_AAC }, - { wxT("matroska"), CODEC_ID_WMAV1 }, - { wxT("matroska"), CODEC_ID_WMAV2 }, - { wxT("matroska"), CODEC_ID_WMAPRO }, - { wxT("matroska"), CODEC_ID_ADPCM_CT }, - { wxT("matroska"), CODEC_ID_ATRAC3 }, - { wxT("matroska"), CODEC_ID_IMC }, - { wxT("matroska"), CODEC_ID_AC3 }, - { wxT("matroska"), CODEC_ID_DTS }, - { wxT("matroska"), CODEC_ID_SONIC }, - { wxT("matroska"), CODEC_ID_SONIC_LS }, - { wxT("matroska"), CODEC_ID_FLAC }, - { wxT("matroska"), CODEC_ID_ADPCM_SWF }, - { wxT("matroska"), CODEC_ID_VORBIS }, - - { wxT("mmf"), CODEC_ID_ADPCM_YAMAHA }, - - { wxT("mov"), CODEC_ID_PCM_S32BE }, //mov - { wxT("mov"), CODEC_ID_PCM_S32LE }, - { wxT("mov"), CODEC_ID_PCM_S24BE }, - { wxT("mov"), CODEC_ID_PCM_S24LE }, - { wxT("mov"), CODEC_ID_PCM_S16BE }, - { wxT("mov"), CODEC_ID_PCM_S16LE }, - { wxT("mov"), CODEC_ID_PCM_S8 }, - { wxT("mov"), CODEC_ID_PCM_U8 }, - { wxT("mov"), CODEC_ID_PCM_MULAW }, - { wxT("mov"), CODEC_ID_PCM_ALAW }, - { wxT("mov"), CODEC_ID_ADPCM_IMA_QT }, - { wxT("mov"), CODEC_ID_MACE3 }, - { wxT("mov"), CODEC_ID_MACE6 }, - { wxT("mov"), CODEC_ID_MP3 }, - { wxT("mov"), CODEC_ID_AAC }, - { wxT("mov"), CODEC_ID_AMR_NB }, - { wxT("mov"), CODEC_ID_AMR_WB }, - { wxT("mov"), CODEC_ID_GSM }, - { wxT("mov"), CODEC_ID_ALAC }, - { wxT("mov"), CODEC_ID_QCELP }, - { wxT("mov"), CODEC_ID_QDM2 }, - { wxT("mov"), CODEC_ID_DVAUDIO }, - { wxT("mov"), CODEC_ID_WMAV2 }, - { wxT("mov"), CODEC_ID_ALAC }, - - { wxT("mp4"), CODEC_ID_AAC }, - { wxT("mp4"), CODEC_ID_QCELP }, - { wxT("mp4"), CODEC_ID_MP3 }, - { wxT("mp4"), CODEC_ID_VORBIS }, - - { wxT("psp"), CODEC_ID_AAC }, - { wxT("psp"), CODEC_ID_QCELP }, - { wxT("psp"), CODEC_ID_MP3 }, - { wxT("psp"), CODEC_ID_VORBIS }, - - { wxT("ipod"), CODEC_ID_AAC }, - { wxT("ipod"), CODEC_ID_QCELP }, - { wxT("ipod"), CODEC_ID_MP3 }, - { wxT("ipod"), CODEC_ID_VORBIS }, - - { wxT("3gp"), CODEC_ID_AAC }, - { wxT("3gp"), CODEC_ID_AMR_NB }, - { wxT("3gp"), CODEC_ID_AMR_WB }, - - { wxT("3g2"), CODEC_ID_AAC }, - { wxT("3g2"), CODEC_ID_AMR_NB }, - { wxT("3g2"), CODEC_ID_AMR_WB }, - - { wxT("mp3"), CODEC_ID_MP3 }, - - { wxT("mpeg"), CODEC_ID_AC3 }, - { wxT("mpeg"), CODEC_ID_DTS }, - { wxT("mpeg"), CODEC_ID_PCM_S16BE }, - { wxT("mpeg"), CODEC_ID_MP2 }, - - { wxT("vcd"), CODEC_ID_AC3 }, - { wxT("vcd"), CODEC_ID_DTS }, - { wxT("vcd"), CODEC_ID_PCM_S16BE }, - { wxT("vcd"), CODEC_ID_MP2 }, - - { wxT("vob"), CODEC_ID_AC3 }, - { wxT("vob"), CODEC_ID_DTS }, - { wxT("vob"), CODEC_ID_PCM_S16BE }, - { wxT("vob"), CODEC_ID_MP2 }, - - { wxT("svcd"), CODEC_ID_AC3 }, - { wxT("svcd"), CODEC_ID_DTS }, - { wxT("svcd"), CODEC_ID_PCM_S16BE }, - { wxT("svcd"), CODEC_ID_MP2 }, - - { wxT("dvd"), CODEC_ID_AC3 }, - { wxT("dvd"), CODEC_ID_DTS }, - { wxT("dvd"), CODEC_ID_PCM_S16BE }, - { wxT("dvd"), CODEC_ID_MP2 }, - - { wxT("nut"), CODEC_ID_PCM_S16LE }, - { wxT("nut"), CODEC_ID_PCM_U8 }, - { wxT("nut"), CODEC_ID_PCM_S24LE }, - { wxT("nut"), CODEC_ID_PCM_S32LE }, - { wxT("nut"), CODEC_ID_ADPCM_MS }, - { wxT("nut"), CODEC_ID_PCM_ALAW }, - { wxT("nut"), CODEC_ID_PCM_MULAW }, - { wxT("nut"), CODEC_ID_WMAVOICE }, - { wxT("nut"), CODEC_ID_ADPCM_IMA_WAV }, - { wxT("nut"), CODEC_ID_ADPCM_YAMAHA }, - { wxT("nut"), CODEC_ID_TRUESPEECH }, - { wxT("nut"), CODEC_ID_GSM_MS }, - { wxT("nut"), CODEC_ID_ADPCM_G726 }, - { wxT("nut"), CODEC_ID_MP2 }, - { wxT("nut"), CODEC_ID_MP3 }, - { wxT("nut"), CODEC_ID_VOXWARE }, - { wxT("nut"), CODEC_ID_AAC }, - { wxT("nut"), CODEC_ID_WMAV1 }, - { wxT("nut"), CODEC_ID_WMAV2 }, - { wxT("nut"), CODEC_ID_WMAPRO }, - { wxT("nut"), CODEC_ID_ADPCM_CT }, - { wxT("nut"), CODEC_ID_ATRAC3 }, - { wxT("nut"), CODEC_ID_IMC }, - { wxT("nut"), CODEC_ID_AC3 }, - { wxT("nut"), CODEC_ID_DTS }, - { wxT("nut"), CODEC_ID_SONIC }, - { wxT("nut"), CODEC_ID_SONIC_LS }, - { wxT("nut"), CODEC_ID_FLAC }, - { wxT("nut"), CODEC_ID_ADPCM_SWF }, - { wxT("nut"), CODEC_ID_VORBIS }, - - { wxT("ogg"), CODEC_ID_VORBIS }, - { wxT("ogg"), CODEC_ID_FLAC }, - - { wxT("ac3"), CODEC_ID_AC3 }, - - { wxT("dts"), CODEC_ID_DTS }, - - { wxT("flac"), CODEC_ID_FLAC }, - - { wxT("RoQ"), CODEC_ID_ROQ_DPCM }, - - { wxT("rm"), CODEC_ID_AC3 }, - - { wxT("swf"), CODEC_ID_MP3 }, - - { wxT("avm2"), CODEC_ID_MP3 }, - - { wxT("voc"), CODEC_ID_PCM_U8 }, - - { wxT("wav"), CODEC_ID_PCM_S16LE }, - { wxT("wav"), CODEC_ID_PCM_U8 }, - { wxT("wav"), CODEC_ID_PCM_S24LE }, - { wxT("wav"), CODEC_ID_PCM_S32LE }, - { wxT("wav"), CODEC_ID_ADPCM_MS }, - { wxT("wav"), CODEC_ID_PCM_ALAW }, - { wxT("wav"), CODEC_ID_PCM_MULAW }, - { wxT("wav"), CODEC_ID_WMAVOICE }, - { wxT("wav"), CODEC_ID_ADPCM_IMA_WAV }, - { wxT("wav"), CODEC_ID_ADPCM_YAMAHA }, - { wxT("wav"), CODEC_ID_TRUESPEECH }, - { wxT("wav"), CODEC_ID_GSM_MS }, - { wxT("wav"), CODEC_ID_ADPCM_G726 }, - { wxT("wav"), CODEC_ID_MP2 }, - { wxT("wav"), CODEC_ID_MP3 }, - { wxT("wav"), CODEC_ID_VOXWARE }, - { wxT("wav"), CODEC_ID_AAC }, - { wxT("wav"), CODEC_ID_WMAV1 }, - { wxT("wav"), CODEC_ID_WMAV2 }, - { wxT("wav"), CODEC_ID_WMAPRO }, - { wxT("wav"), CODEC_ID_ADPCM_CT }, - { wxT("wav"), CODEC_ID_ATRAC3 }, - { wxT("wav"), CODEC_ID_IMC }, - { wxT("wav"), CODEC_ID_AC3 }, - { wxT("wav"), CODEC_ID_DTS }, - { wxT("wav"), CODEC_ID_SONIC }, - { wxT("wav"), CODEC_ID_SONIC_LS }, - { wxT("wav"), CODEC_ID_FLAC }, - { wxT("wav"), CODEC_ID_ADPCM_SWF }, - { wxT("wav"), CODEC_ID_VORBIS }, + { wxT("aiff"), AV_CODEC_ID_PCM_S16BE }, + { wxT("aiff"), AV_CODEC_ID_PCM_S8 }, + { wxT("aiff"), AV_CODEC_ID_PCM_S24BE }, + { wxT("aiff"), AV_CODEC_ID_PCM_S32BE }, + { wxT("aiff"), AV_CODEC_ID_PCM_ALAW }, + { wxT("aiff"), AV_CODEC_ID_PCM_MULAW }, + { wxT("aiff"), AV_CODEC_ID_MACE3 }, + { wxT("aiff"), AV_CODEC_ID_MACE6 }, + { wxT("aiff"), AV_CODEC_ID_GSM }, + { wxT("aiff"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("aiff"), AV_CODEC_ID_PCM_S16LE }, + { wxT("aiff"), AV_CODEC_ID_ADPCM_IMA_QT }, + { wxT("aiff"), AV_CODEC_ID_QDM2 }, + + { wxT("amr"), AV_CODEC_ID_AMR_NB }, + { wxT("amr"), AV_CODEC_ID_AMR_WB }, + + { wxT("asf"), AV_CODEC_ID_PCM_S16LE }, + { wxT("asf"), AV_CODEC_ID_PCM_U8 }, + { wxT("asf"), AV_CODEC_ID_PCM_S24LE }, + { wxT("asf"), AV_CODEC_ID_PCM_S32LE }, + { wxT("asf"), AV_CODEC_ID_ADPCM_MS }, + { wxT("asf"), AV_CODEC_ID_PCM_ALAW }, + { wxT("asf"), AV_CODEC_ID_PCM_MULAW }, + { wxT("asf"), AV_CODEC_ID_WMAVOICE }, + { wxT("asf"), AV_CODEC_ID_ADPCM_IMA_WAV }, + { wxT("asf"), AV_CODEC_ID_ADPCM_YAMAHA }, + { wxT("asf"), AV_CODEC_ID_TRUESPEECH }, + { wxT("asf"), AV_CODEC_ID_GSM_MS }, + { wxT("asf"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("asf"), AV_CODEC_ID_MP2 }, + { wxT("asf"), AV_CODEC_ID_MP3 }, + { wxT("asf"), AV_CODEC_ID_VOXWARE }, + { wxT("asf"), AV_CODEC_ID_AAC }, + { wxT("asf"), AV_CODEC_ID_WMAV1 }, + { wxT("asf"), AV_CODEC_ID_WMAV2 }, + { wxT("asf"), AV_CODEC_ID_WMAPRO }, + { wxT("asf"), AV_CODEC_ID_ADPCM_CT }, + { wxT("asf"), AV_CODEC_ID_ATRAC3 }, + { wxT("asf"), AV_CODEC_ID_IMC }, + { wxT("asf"), AV_CODEC_ID_AC3 }, + { wxT("asf"), AV_CODEC_ID_DTS }, + { wxT("asf"), AV_CODEC_ID_FLAC }, + { wxT("asf"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("asf"), AV_CODEC_ID_VORBIS }, + + { wxT("au"), AV_CODEC_ID_PCM_MULAW }, + { wxT("au"), AV_CODEC_ID_PCM_S8 }, + { wxT("au"), AV_CODEC_ID_PCM_S16BE }, + { wxT("au"), AV_CODEC_ID_PCM_ALAW }, + + { wxT("avi"), AV_CODEC_ID_PCM_S16LE }, + { wxT("avi"), AV_CODEC_ID_PCM_U8 }, + { wxT("avi"), AV_CODEC_ID_PCM_S24LE }, + { wxT("avi"), AV_CODEC_ID_PCM_S32LE }, + { wxT("avi"), AV_CODEC_ID_ADPCM_MS }, + { wxT("avi"), AV_CODEC_ID_PCM_ALAW }, + { wxT("avi"), AV_CODEC_ID_PCM_MULAW }, + { wxT("avi"), AV_CODEC_ID_WMAVOICE }, + { wxT("avi"), AV_CODEC_ID_ADPCM_IMA_WAV }, + { wxT("avi"), AV_CODEC_ID_ADPCM_YAMAHA }, + { wxT("avi"), AV_CODEC_ID_TRUESPEECH }, + { wxT("avi"), AV_CODEC_ID_GSM_MS }, + { wxT("avi"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("avi"), AV_CODEC_ID_MP2 }, + { wxT("avi"), AV_CODEC_ID_MP3 }, + { wxT("avi"), AV_CODEC_ID_VOXWARE }, + { wxT("avi"), AV_CODEC_ID_AAC }, + { wxT("avi"), AV_CODEC_ID_WMAV1 }, + { wxT("avi"), AV_CODEC_ID_WMAV2 }, + { wxT("avi"), AV_CODEC_ID_WMAPRO }, + { wxT("avi"), AV_CODEC_ID_ADPCM_CT }, + { wxT("avi"), AV_CODEC_ID_ATRAC3 }, + { wxT("avi"), AV_CODEC_ID_IMC }, + { wxT("avi"), AV_CODEC_ID_AC3 }, + { wxT("avi"), AV_CODEC_ID_DTS }, + { wxT("avi"), AV_CODEC_ID_FLAC }, + { wxT("avi"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("avi"), AV_CODEC_ID_VORBIS }, + + { wxT("crc"), AV_CODEC_ID_NONE }, + + { wxT("dv"), AV_CODEC_ID_PCM_S16LE }, + + { wxT("ffm"), AV_CODEC_ID_NONE }, + + { wxT("flv"), AV_CODEC_ID_MP3 }, + { wxT("flv"), AV_CODEC_ID_PCM_S8 }, + { wxT("flv"), AV_CODEC_ID_PCM_S16BE }, + { wxT("flv"), AV_CODEC_ID_PCM_S16LE }, + { wxT("flv"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("flv"), AV_CODEC_ID_AAC }, + { wxT("flv"), AV_CODEC_ID_NELLYMOSER }, + + { wxT("framecrc"), AV_CODEC_ID_NONE }, + + { wxT("gxf"), AV_CODEC_ID_PCM_S16LE }, + + { wxT("matroska"), AV_CODEC_ID_PCM_S16LE }, + { wxT("matroska"), AV_CODEC_ID_PCM_U8 }, + { wxT("matroska"), AV_CODEC_ID_PCM_S24LE }, + { wxT("matroska"), AV_CODEC_ID_PCM_S32LE }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_MS }, + { wxT("matroska"), AV_CODEC_ID_PCM_ALAW }, + { wxT("matroska"), AV_CODEC_ID_PCM_MULAW }, + { wxT("matroska"), AV_CODEC_ID_WMAVOICE }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_IMA_WAV }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_YAMAHA }, + { wxT("matroska"), AV_CODEC_ID_TRUESPEECH }, + { wxT("matroska"), AV_CODEC_ID_GSM_MS }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("matroska"), AV_CODEC_ID_MP2 }, + { wxT("matroska"), AV_CODEC_ID_MP3 }, + { wxT("matroska"), AV_CODEC_ID_VOXWARE }, + { wxT("matroska"), AV_CODEC_ID_AAC }, + { wxT("matroska"), AV_CODEC_ID_WMAV1 }, + { wxT("matroska"), AV_CODEC_ID_WMAV2 }, + { wxT("matroska"), AV_CODEC_ID_WMAPRO }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_CT }, + { wxT("matroska"), AV_CODEC_ID_ATRAC3 }, + { wxT("matroska"), AV_CODEC_ID_IMC }, + { wxT("matroska"), AV_CODEC_ID_AC3 }, + { wxT("matroska"), AV_CODEC_ID_DTS }, + { wxT("matroska"), AV_CODEC_ID_FLAC }, + { wxT("matroska"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("matroska"), AV_CODEC_ID_VORBIS }, + + { wxT("mmf"), AV_CODEC_ID_ADPCM_YAMAHA }, + + { wxT("mov"), AV_CODEC_ID_PCM_S32BE }, //mov + { wxT("mov"), AV_CODEC_ID_PCM_S32LE }, + { wxT("mov"), AV_CODEC_ID_PCM_S24BE }, + { wxT("mov"), AV_CODEC_ID_PCM_S24LE }, + { wxT("mov"), AV_CODEC_ID_PCM_S16BE }, + { wxT("mov"), AV_CODEC_ID_PCM_S16LE }, + { wxT("mov"), AV_CODEC_ID_PCM_S8 }, + { wxT("mov"), AV_CODEC_ID_PCM_U8 }, + { wxT("mov"), AV_CODEC_ID_PCM_MULAW }, + { wxT("mov"), AV_CODEC_ID_PCM_ALAW }, + { wxT("mov"), AV_CODEC_ID_ADPCM_IMA_QT }, + { wxT("mov"), AV_CODEC_ID_MACE3 }, + { wxT("mov"), AV_CODEC_ID_MACE6 }, + { wxT("mov"), AV_CODEC_ID_MP3 }, + { wxT("mov"), AV_CODEC_ID_AAC }, + { wxT("mov"), AV_CODEC_ID_AMR_NB }, + { wxT("mov"), AV_CODEC_ID_AMR_WB }, + { wxT("mov"), AV_CODEC_ID_GSM }, + { wxT("mov"), AV_CODEC_ID_ALAC }, + { wxT("mov"), AV_CODEC_ID_QCELP }, + { wxT("mov"), AV_CODEC_ID_QDM2 }, + { wxT("mov"), AV_CODEC_ID_DVAUDIO }, + { wxT("mov"), AV_CODEC_ID_WMAV2 }, + { wxT("mov"), AV_CODEC_ID_ALAC }, + + { wxT("mp4"), AV_CODEC_ID_AAC }, + { wxT("mp4"), AV_CODEC_ID_QCELP }, + { wxT("mp4"), AV_CODEC_ID_MP3 }, + { wxT("mp4"), AV_CODEC_ID_VORBIS }, + + { wxT("psp"), AV_CODEC_ID_AAC }, + { wxT("psp"), AV_CODEC_ID_QCELP }, + { wxT("psp"), AV_CODEC_ID_MP3 }, + { wxT("psp"), AV_CODEC_ID_VORBIS }, + + { wxT("ipod"), AV_CODEC_ID_AAC }, + { wxT("ipod"), AV_CODEC_ID_QCELP }, + { wxT("ipod"), AV_CODEC_ID_MP3 }, + { wxT("ipod"), AV_CODEC_ID_VORBIS }, + + { wxT("3gp"), AV_CODEC_ID_AAC }, + { wxT("3gp"), AV_CODEC_ID_AMR_NB }, + { wxT("3gp"), AV_CODEC_ID_AMR_WB }, + + { wxT("3g2"), AV_CODEC_ID_AAC }, + { wxT("3g2"), AV_CODEC_ID_AMR_NB }, + { wxT("3g2"), AV_CODEC_ID_AMR_WB }, + + { wxT("mp3"), AV_CODEC_ID_MP3 }, + + { wxT("mpeg"), AV_CODEC_ID_AC3 }, + { wxT("mpeg"), AV_CODEC_ID_DTS }, + { wxT("mpeg"), AV_CODEC_ID_PCM_S16BE }, + { wxT("mpeg"), AV_CODEC_ID_MP2 }, + + { wxT("vcd"), AV_CODEC_ID_AC3 }, + { wxT("vcd"), AV_CODEC_ID_DTS }, + { wxT("vcd"), AV_CODEC_ID_PCM_S16BE }, + { wxT("vcd"), AV_CODEC_ID_MP2 }, + + { wxT("vob"), AV_CODEC_ID_AC3 }, + { wxT("vob"), AV_CODEC_ID_DTS }, + { wxT("vob"), AV_CODEC_ID_PCM_S16BE }, + { wxT("vob"), AV_CODEC_ID_MP2 }, + + { wxT("svcd"), AV_CODEC_ID_AC3 }, + { wxT("svcd"), AV_CODEC_ID_DTS }, + { wxT("svcd"), AV_CODEC_ID_PCM_S16BE }, + { wxT("svcd"), AV_CODEC_ID_MP2 }, + + { wxT("dvd"), AV_CODEC_ID_AC3 }, + { wxT("dvd"), AV_CODEC_ID_DTS }, + { wxT("dvd"), AV_CODEC_ID_PCM_S16BE }, + { wxT("dvd"), AV_CODEC_ID_MP2 }, + + { wxT("nut"), AV_CODEC_ID_PCM_S16LE }, + { wxT("nut"), AV_CODEC_ID_PCM_U8 }, + { wxT("nut"), AV_CODEC_ID_PCM_S24LE }, + { wxT("nut"), AV_CODEC_ID_PCM_S32LE }, + { wxT("nut"), AV_CODEC_ID_ADPCM_MS }, + { wxT("nut"), AV_CODEC_ID_PCM_ALAW }, + { wxT("nut"), AV_CODEC_ID_PCM_MULAW }, + { wxT("nut"), AV_CODEC_ID_WMAVOICE }, + { wxT("nut"), AV_CODEC_ID_ADPCM_IMA_WAV }, + { wxT("nut"), AV_CODEC_ID_ADPCM_YAMAHA }, + { wxT("nut"), AV_CODEC_ID_TRUESPEECH }, + { wxT("nut"), AV_CODEC_ID_GSM_MS }, + { wxT("nut"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("nut"), AV_CODEC_ID_MP2 }, + { wxT("nut"), AV_CODEC_ID_MP3 }, + { wxT("nut"), AV_CODEC_ID_VOXWARE }, + { wxT("nut"), AV_CODEC_ID_AAC }, + { wxT("nut"), AV_CODEC_ID_WMAV1 }, + { wxT("nut"), AV_CODEC_ID_WMAV2 }, + { wxT("nut"), AV_CODEC_ID_WMAPRO }, + { wxT("nut"), AV_CODEC_ID_ADPCM_CT }, + { wxT("nut"), AV_CODEC_ID_ATRAC3 }, + { wxT("nut"), AV_CODEC_ID_IMC }, + { wxT("nut"), AV_CODEC_ID_AC3 }, + { wxT("nut"), AV_CODEC_ID_DTS }, + { wxT("nut"), AV_CODEC_ID_FLAC }, + { wxT("nut"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("nut"), AV_CODEC_ID_VORBIS }, + + { wxT("ogg"), AV_CODEC_ID_VORBIS }, + { wxT("ogg"), AV_CODEC_ID_FLAC }, + + { wxT("ac3"), AV_CODEC_ID_AC3 }, + + { wxT("dts"), AV_CODEC_ID_DTS }, + + { wxT("flac"), AV_CODEC_ID_FLAC }, + + { wxT("RoQ"), AV_CODEC_ID_ROQ_DPCM }, + + { wxT("rm"), AV_CODEC_ID_AC3 }, + + { wxT("swf"), AV_CODEC_ID_MP3 }, + + { wxT("avm2"), AV_CODEC_ID_MP3 }, + + { wxT("voc"), AV_CODEC_ID_PCM_U8 }, + + { wxT("wav"), AV_CODEC_ID_PCM_S16LE }, + { wxT("wav"), AV_CODEC_ID_PCM_U8 }, + { wxT("wav"), AV_CODEC_ID_PCM_S24LE }, + { wxT("wav"), AV_CODEC_ID_PCM_S32LE }, + { wxT("wav"), AV_CODEC_ID_ADPCM_MS }, + { wxT("wav"), AV_CODEC_ID_PCM_ALAW }, + { wxT("wav"), AV_CODEC_ID_PCM_MULAW }, + { wxT("wav"), AV_CODEC_ID_WMAVOICE }, + { wxT("wav"), AV_CODEC_ID_ADPCM_IMA_WAV }, + { wxT("wav"), AV_CODEC_ID_ADPCM_YAMAHA }, + { wxT("wav"), AV_CODEC_ID_TRUESPEECH }, + { wxT("wav"), AV_CODEC_ID_GSM_MS }, + { wxT("wav"), AV_CODEC_ID_ADPCM_G726 }, + { wxT("wav"), AV_CODEC_ID_MP2 }, + { wxT("wav"), AV_CODEC_ID_MP3 }, + { wxT("wav"), AV_CODEC_ID_VOXWARE }, + { wxT("wav"), AV_CODEC_ID_AAC }, + { wxT("wav"), AV_CODEC_ID_WMAV1 }, + { wxT("wav"), AV_CODEC_ID_WMAV2 }, + { wxT("wav"), AV_CODEC_ID_WMAPRO }, + { wxT("wav"), AV_CODEC_ID_ADPCM_CT }, + { wxT("wav"), AV_CODEC_ID_ATRAC3 }, + { wxT("wav"), AV_CODEC_ID_IMC }, + { wxT("wav"), AV_CODEC_ID_AC3 }, + { wxT("wav"), AV_CODEC_ID_DTS }, + { wxT("wav"), AV_CODEC_ID_FLAC }, + { wxT("wav"), AV_CODEC_ID_ADPCM_SWF }, + { wxT("wav"), AV_CODEC_ID_VORBIS }, - { NULL, CODEC_ID_NONE } + { NULL, AV_CODEC_ID_NONE } }; /// AAC profiles @@ -1110,11 +1100,11 @@ /// List of export types ExposedFormat ExportFFmpegOptions::fmts[] = { - {FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_VERSION_INT(-1,-1,-1), true, _("M4A (AAC) Files (FFmpeg)"), CODEC_ID_AAC, true}, - {FMT_AC3, wxT("AC3"), wxT("ac3"), wxT("ac3"), 7, AV_VERSION_INT(0,0,0), false, _("AC3 Files (FFmpeg)"), CODEC_ID_AC3, true}, - {FMT_AMRNB, wxT("AMRNB"), wxT("amr"), wxT("amr"), 1, AV_VERSION_INT(0,0,0), false, _("AMR (narrow band) Files (FFmpeg)"), CODEC_ID_AMR_NB, true}, - {FMT_WMA2, wxT("WMA"), wxT("wma"), wxT("asf"), 2, AV_VERSION_INT(52,53,0), false, _("WMA (version 2) Files (FFmpeg)"), CODEC_ID_WMAV2, true}, - {FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_VERSION_INT(-1,-1,-1), true, _("Custom FFmpeg Export"), CODEC_ID_NONE, true} + {FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_VERSION_INT(-1,-1,-1), true, _("M4A (AAC) Files (FFmpeg)"), AV_CODEC_ID_AAC, true}, + {FMT_AC3, wxT("AC3"), wxT("ac3"), wxT("ac3"), 7, AV_VERSION_INT(0,0,0), false, _("AC3 Files (FFmpeg)"), AV_CODEC_ID_AC3, true}, + {FMT_AMRNB, wxT("AMRNB"), wxT("amr"), wxT("amr"), 1, AV_VERSION_INT(0,0,0), false, _("AMR (narrow band) Files (FFmpeg)"), AV_CODEC_ID_AMR_NB, true}, + {FMT_WMA2, wxT("WMA"), wxT("wma"), wxT("asf"), 2, AV_VERSION_INT(52,53,0), false, _("WMA (version 2) Files (FFmpeg)"), AV_CODEC_ID_WMAV2, true}, + {FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_VERSION_INT(-1,-1,-1), true, _("Custom FFmpeg Export"), AV_CODEC_ID_NONE, true} }; /// Sample rates supported by AAC encoder (must end with zero-element) @@ -1125,84 +1115,84 @@ /// Syntax: first, enable a control for each applicable format-codec combination /// then disable it for anything else /// "any" - any format -/// CODEC_ID_NONE - any codec -/// This list must end with {FALSE,FFmpegExportCtrlID(0),CODEC_ID_NONE,NULL} -ApplicableFor ExportFFmpegOptions::apptable[] = -{ - {TRUE,FEQualityID,CODEC_ID_AAC,"any"}, - {TRUE,FEQualityID,CODEC_ID_MP3,"any"}, - {TRUE,FEQualityID,CODEC_ID_VORBIS,"any"}, - {FALSE,FEQualityID,CODEC_ID_NONE,"any"}, - - {TRUE,FECutoffID,CODEC_ID_AC3,"any"}, - {TRUE,FECutoffID,CODEC_ID_AAC,"any"}, - {TRUE,FECutoffID,CODEC_ID_VORBIS,"any"}, - {FALSE,FECutoffID,CODEC_ID_NONE,"any"}, - - {TRUE,FEFrameSizeID,CODEC_ID_FLAC,"any"}, - {FALSE,FEFrameSizeID,CODEC_ID_NONE,"any"}, - - {TRUE,FEProfileID,CODEC_ID_AAC,"any"}, - {FALSE,FEProfileID,CODEC_ID_NONE,"any"}, - - {TRUE,FECompLevelID,CODEC_ID_FLAC,"any"}, - {FALSE,FECompLevelID,CODEC_ID_NONE,"any"}, - - {TRUE,FEUseLPCID,CODEC_ID_FLAC,"any"}, - {FALSE,FEUseLPCID,CODEC_ID_NONE,"any"}, - - {TRUE,FELPCCoeffsID,CODEC_ID_FLAC,"any"}, - {FALSE,FELPCCoeffsID,CODEC_ID_NONE,"any"}, - - {TRUE,FEMinPredID,CODEC_ID_FLAC,"any"}, - {FALSE,FEMinPredID,CODEC_ID_NONE,"any"}, - - {TRUE,FEMaxPredID,CODEC_ID_FLAC,"any"}, - {FALSE,FEMaxPredID,CODEC_ID_NONE,"any"}, - - {TRUE,FEPredOrderID,CODEC_ID_FLAC,"any"}, - {FALSE,FEPredOrderID,CODEC_ID_NONE,"any"}, - - {TRUE,FEMinPartOrderID,CODEC_ID_FLAC,"any"}, - {FALSE,FEMinPartOrderID,CODEC_ID_NONE,"any"}, - - {TRUE,FEMaxPartOrderID,CODEC_ID_FLAC,"any"}, - {FALSE,FEMaxPartOrderID,CODEC_ID_NONE,"any"}, - - {TRUE,FEMuxRateID,CODEC_ID_NONE,"mpeg"}, - {TRUE,FEMuxRateID,CODEC_ID_NONE,"vcd"}, - {TRUE,FEMuxRateID,CODEC_ID_NONE,"vob"}, - {TRUE,FEMuxRateID,CODEC_ID_NONE,"svcd"}, - {TRUE,FEMuxRateID,CODEC_ID_NONE,"dvd"}, - {FALSE,FEMuxRateID,CODEC_ID_NONE,"any"}, - - {TRUE,FEPacketSizeID,CODEC_ID_NONE,"mpeg"}, - {TRUE,FEPacketSizeID,CODEC_ID_NONE,"vcd"}, - {TRUE,FEPacketSizeID,CODEC_ID_NONE,"vob"}, - {TRUE,FEPacketSizeID,CODEC_ID_NONE,"svcd"}, - {TRUE,FEPacketSizeID,CODEC_ID_NONE,"dvd"}, - {FALSE,FEPacketSizeID,CODEC_ID_NONE,"any"}, - - {TRUE,FELanguageID,CODEC_ID_NONE,"matroska"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"mov"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"3gp"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"mp4"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"psp"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"3g2"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"ipod"}, - {TRUE,FELanguageID,CODEC_ID_NONE,"mpegts"}, - {FALSE,FELanguageID,CODEC_ID_NONE,"any"}, - - {TRUE,FEBitReservoirID,CODEC_ID_MP3,"any"}, - {TRUE,FEBitReservoirID,CODEC_ID_WMAV1,"any"}, - {TRUE,FEBitReservoirID,CODEC_ID_WMAV2,"any"}, - {FALSE,FEBitReservoirID,CODEC_ID_NONE,"any"}, - - {TRUE,FEVariableBlockLenID,CODEC_ID_WMAV1,"any"}, - {TRUE,FEVariableBlockLenID,CODEC_ID_WMAV2,"any"}, - {FALSE,FEVariableBlockLenID,CODEC_ID_NONE,"any"}, +/// AV_CODEC_ID_NONE - any codec +/// This list must end with {FALSE,FFmpegExportCtrlID(0),AV_CODEC_ID_NONE,NULL} +ApplicableFor ExportFFmpegOptions::apptable[] = +{ + {TRUE,FEQualityID,AV_CODEC_ID_AAC,"any"}, + {TRUE,FEQualityID,AV_CODEC_ID_MP3,"any"}, + {TRUE,FEQualityID,AV_CODEC_ID_VORBIS,"any"}, + {FALSE,FEQualityID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FECutoffID,AV_CODEC_ID_AC3,"any"}, + {TRUE,FECutoffID,AV_CODEC_ID_AAC,"any"}, + {TRUE,FECutoffID,AV_CODEC_ID_VORBIS,"any"}, + {FALSE,FECutoffID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEFrameSizeID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEFrameSizeID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEProfileID,AV_CODEC_ID_AAC,"any"}, + {FALSE,FEProfileID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FECompLevelID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FECompLevelID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEUseLPCID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEUseLPCID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FELPCCoeffsID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FELPCCoeffsID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEMinPredID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEMinPredID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEMaxPredID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEMaxPredID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEPredOrderID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEPredOrderID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEMinPartOrderID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEMinPartOrderID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEMaxPartOrderID,AV_CODEC_ID_FLAC,"any"}, + {FALSE,FEMaxPartOrderID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"mpeg"}, + {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"vcd"}, + {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"vob"}, + {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"svcd"}, + {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"dvd"}, + {FALSE,FEMuxRateID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"mpeg"}, + {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"vcd"}, + {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"vob"}, + {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"svcd"}, + {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"dvd"}, + {FALSE,FEPacketSizeID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"matroska"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mov"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"3gp"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mp4"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"psp"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"3g2"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"ipod"}, + {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mpegts"}, + {FALSE,FELanguageID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEBitReservoirID,AV_CODEC_ID_MP3,"any"}, + {TRUE,FEBitReservoirID,AV_CODEC_ID_WMAV1,"any"}, + {TRUE,FEBitReservoirID,AV_CODEC_ID_WMAV2,"any"}, + {FALSE,FEBitReservoirID,AV_CODEC_ID_NONE,"any"}, + + {TRUE,FEVariableBlockLenID,AV_CODEC_ID_WMAV1,"any"}, + {TRUE,FEVariableBlockLenID,AV_CODEC_ID_WMAV2,"any"}, + {FALSE,FEVariableBlockLenID,AV_CODEC_ID_NONE,"any"}, - {FALSE,FFmpegExportCtrlID(0),CODEC_ID_NONE,NULL} + {FALSE,FFmpegExportCtrlID(0),AV_CODEC_ID_NONE,NULL} }; /// Prediction order method - names. Labels are indices of this array. @@ -1251,7 +1241,7 @@ DoOnFormatList(); //Select the codec that was selected last time this dialog was closed - AVCodec *codec = avcodec_find_encoder((CodecID)gPrefs->Read(wxT("/FileFormats/FFmpegCodec"),(long)CODEC_ID_NONE)); + AVCodec *codec = avcodec_find_encoder_by_name(gPrefs->Read(wxT("/FileFormats/FFmpegCodec")).ToUTF8()); if (codec != NULL) mCodecList->Select(mCodecList->FindString(wxString::FromUTF8(codec->name))); DoOnCodecList(); } @@ -1268,7 +1258,7 @@ { // Any audio-capable format has default audio codec. // If it doesn't, then it doesn't supports any audio codecs - if (ofmt->audio_codec != CODEC_ID_NONE) + if (ofmt->audio_codec != AV_CODEC_ID_NONE) { mFormatNames.Add(wxString::FromUTF8(ofmt->name)); mFormatLongNames.Add(wxString::Format(wxT("%s - %s"),mFormatNames.Last().c_str(),wxString::FromUTF8(ofmt->long_name).c_str())); @@ -1288,7 +1278,7 @@ while ((codec = av_codec_next(codec))) { // We're only interested in audio and only in encoders - if (codec->type == CODEC_TYPE_AUDIO && codec->encode) + if (codec->type == AVMEDIA_TYPE_AUDIO && av_codec_is_encoder(codec)) { mCodecNames.Add(wxString::FromUTF8(codec->name)); mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last().c_str(),wxString::FromUTF8(codec->long_name).c_str())); @@ -1299,157 +1289,156 @@ mShownCodecLongNames = mCodecLongNames; } -/// -/// +/// +/// void ExportFFmpegOptions::PopulateOrExchange(ShuttleGui & S) { S.StartVerticalLay(1); S.StartMultiColumn(1, wxEXPAND); { - S.SetStretchyRow(3); - S.StartMultiColumn(7, wxEXPAND); - { - S.SetStretchyCol(1); - mPresetCombo = S.Id(FEPresetID).AddCombo(_("Preset:"), gPrefs->Read(wxT("/FileFormats/FFmpegPreset"),wxEmptyString), mPresetNames); - mLoadPreset = S.Id(FELoadPresetID).AddButton(_("Load Preset")); - mSavePreset = S.Id(FESavePresetID).AddButton(_("Save Preset")); - mDeletePreset = S.Id(FEDeletePresetID).AddButton(_("Delete Preset")); - mImportPresets = S.Id(FEImportPresetsID).AddButton(_("Import Presets")); - mExportPresets = S.Id(FEExportPresetsID).AddButton(_("Export Presets")); - } - S.EndMultiColumn(); - S.StartMultiColumn(4, wxALIGN_LEFT); - { - S.SetStretchyCol(1); - S.SetStretchyCol(3); - S.Id(FEFormatLabelID).AddFixedText(_("Format:")); - mFormatName = S.Id(FEFormatNameID).AddVariableText(wxT("")); - S.Id(FECodecLabelID).AddFixedText(_("Codec:")); - mCodecName = S.Id(FECodecNameID).AddVariableText(wxT("")); - } - S.EndMultiColumn(); - S.AddVariableText(_("Not all formats and codecs are compatible. Nor are all option combinations compatible with all codecs."), false); - S.StartMultiColumn(2, wxEXPAND); - { - S.StartMultiColumn(2, wxEXPAND); - { - S.SetStretchyRow(1); - S.Id(FEAllFormatsID).AddButton(_("Show All Formats")); - S.Id(FEAllCodecsID).AddButton(_("Show All Codecs")); - mFormatList = S.Id(FEFormatID).AddListBox(&mFormatNames); - mFormatList->DeselectAll(); - mCodecList = S.Id(FECodecID).AddListBox(&mCodecNames); - mCodecList->DeselectAll(); - } - S.EndMultiColumn(); - S.StartVerticalLay(); - { -// S.StartScroller( ); - S.SetBorder( 3 ); - S.StartStatic(_("General Options"), 0); - { - S.StartMultiColumn(8, wxEXPAND); - { - mLanguageText = S.Id(FELanguageID).TieTextBox(_("Language:"), wxT("/FileFormats/FFmpegLanguage"), wxEmptyString, 9); - mLanguageText->SetToolTip(_("ISO 639 3-letter language code\nOptional\nempty - automatic")); - - S.AddSpace( 20,0 ); - S.AddVariableText(_("Bit Reservoir")); - S.Id(FEBitReservoirID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegBitReservoir"), true); - - S.AddSpace( 20,0 ); - S.AddVariableText(_("VBL")); - S.Id(FEVariableBlockLenID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegVariableBlockLen"), true); - } - S.EndMultiColumn(); - S.StartMultiColumn(4, wxALIGN_LEFT); - { - mTag = S.Id(FETagID).TieTextBox(_("Tag:"), wxT("/FileFormats/FFmpegTag"), wxEmptyString, 4); - mTag->SetToolTip(_("Codec tag (FOURCC)\nOptional\nempty - automatic")); - - mBitrateSpin = S.Id(FEBitrateID).TieSpinCtrl(_("Bit Rate:"), wxT("/FileFormats/FFmpegBitRate"), 0, 1000000, 0); - mBitrateSpin->SetToolTip(_("Bit Rate (bits/second) - influences the resulting file size and quality\nSome codecs may only accept specific values (128k, 192k, 256k etc)\n0 - automatic\nRecommended - 192000")); - - mQualitySpin = S.Id(FEQualityID).TieSpinCtrl(_("Quality:"), wxT("/FileFormats/FFmpegQuality"), 0, 500, -1); - mQualitySpin->SetToolTip(_("Overall quality, used differently by different codecs\nRequired for vorbis\n0 - automatic\n-1 - off (use bitrate instead)")); - - mSampleRateSpin = S.Id(FESampleRateID).TieSpinCtrl(_("Sample Rate:"), wxT("/FileFormats/FFmpegSampleRate"), 0, 200000, 0); - mSampleRateSpin->SetToolTip(_("Sample rate (Hz)\n0 - don't change sample rate")); - - mCutoffSpin = S.Id(FECutoffID).TieSpinCtrl(_("Cutoff:"), wxT("/FileFormats/FFmpegCutOff"), 0, 10000000, 0); - mCutoffSpin->SetToolTip(_("Audio cutoff bandwidth (Hz)\nOptional\n0 - automatic")); - - mProfileChoice = S.Id(FEProfileID).TieChoice(_("Profile:"), wxT("/FileFormats/FFmpegAACProfile"), - mProfileLabels[0], mProfileNames, mProfileLabels); - mProfileChoice->SetSizeHints( 100,-1); - mProfileChoice->SetToolTip(_("AAC Profile\nLow Complexity -default\nMost players won't play anything other than LC")); - - } - S.EndMultiColumn(); - } - S.EndStatic(); - S.StartStatic(_("FLAC options"),0); - { - S.StartMultiColumn(4, wxALIGN_LEFT); - { - mCompressionLevelSpin = S.Id(FECompLevelID).TieSpinCtrl(_("Compression:"), wxT("/FileFormats/FFmpegCompLevel"), 0, 10, -1); - mCompressionLevelSpin->SetToolTip(_("Compression level\nRequired for FLAC\n-1 - automatic\nmin - 0 (fast encoding, large output file)\nmax - 10 (slow encoding, small output file)")); - - mFrameSizeSpin = S.Id(FEFrameSizeID).TieSpinCtrl(_("Frame:"), wxT("/FileFormats/FFmpegFrameSize"), 0, 65535, 0); - mFrameSizeSpin->SetToolTip(_("Frame size\nOptional\n0 - default\nmin - 16\nmax - 65535")); - - mLPCCoeffsPrecisionSpin = S.Id(FELPCCoeffsID).TieSpinCtrl(_("LPC"), wxT("/FileFormats/FFmpegLPCCoefPrec"), 0, 15, 0); - mLPCCoeffsPrecisionSpin->SetToolTip(_("LPC coefficients precision\nOptional\n0 - default\nmin - 1\nmax - 15")); - - mPredictionOrderMethodChoice = S.Id(FEPredOrderID).TieChoice(_("PdO Method:"), wxT("/FileFormats/FFmpegPredOrderMethod"), - mPredictionOrderMethodLabels[4], mPredictionOrderMethodNames, mPredictionOrderMethodLabels); - mPredictionOrderMethodChoice->SetSizeHints( 100,-1); - mPredictionOrderMethodChoice->SetToolTip(_("Prediction Order Method\nEstimate - fastest, lower compression\nLog search - slowest, best compression\nFull search - default")); - - mMinPredictionOrderSpin = S.Id(FEMinPredID).TieSpinCtrl(_("Min. PdO"), wxT("/FileFormats/FFmpegMinPredOrder"), -1, 32, -1); - mMinPredictionOrderSpin->SetToolTip(_("Minimal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); - - mMaxPredictionOrderSpin = S.Id(FEMaxPredID).TieSpinCtrl(_("Max. PdO"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1, 32, -1); - mMaxPredictionOrderSpin->SetToolTip(_("Maximal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); - - mMinPartitionOrderSpin = S.Id(FEMinPartOrderID).TieSpinCtrl(_("Min. PtO"), wxT("/FileFormats/FFmpegMinPartOrder"), -1, 8, -1); - mMinPartitionOrderSpin->SetToolTip(_("Minimal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); - - mMaxPartitionOrderSpin = S.Id(FEMaxPartOrderID).TieSpinCtrl(_("Max. PtO"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1, 8, -1); - mMaxPartitionOrderSpin->SetToolTip(_("Maximal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); - - S.AddVariableText(_("Use LPC")); - S.Id(FEUseLPCID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegUseLPC"), true); - - } - S.EndMultiColumn(); - } - S.EndStatic(); - S.StartStatic(_("MPEG container options"),0); - { - S.StartMultiColumn(4, wxALIGN_LEFT); - { - /* i18n-hint: 'mux' is short for multiplexor, a device that selects between several inputs - 'Mux Rate' is a parameter that has some bearing on compression ratio for MPEG - it has a hard to predict effect on the degree of compression */ - mMuxRate = S.Id(FEMuxRateID).TieSpinCtrl(_("Mux Rate:"), wxT("/FileFormats/FFmpegMuxRate"), 0, 10000000, 0); - mMuxRate->SetToolTip(_("Maximum bit rate of the multiplexed stream\nOptional\n0 - default")); - - /* i18n-hint: 'Packet Size' is a parameter that has some bearing on compression ratio for MPEG - compression. It measures how big a chunk of audio is compressed in one piece. */ - mPacketSize = S.Id(FEPacketSizeID).TieSpinCtrl(_("Packet Size:"), wxT("/FileFormats/FFmpegPacketSize"), 0, 10000000, 0); - mPacketSize->SetToolTip(_("Packet size\nOptional\n0 - default")); - } - S.EndMultiColumn(); - } - S.EndStatic(); -// S.EndScroller(); - S.SetBorder( 5 ); - S.AddStandardButtons(); - } - S.EndVerticalLay(); - } - S.EndMultiColumn(); + S.SetStretchyRow(3); + S.StartMultiColumn(7, wxEXPAND); + { + S.SetStretchyCol(1); + mPresetCombo = S.Id(FEPresetID).AddCombo(_("Preset:"), gPrefs->Read(wxT("/FileFormats/FFmpegPreset"),wxEmptyString), mPresetNames); + mLoadPreset = S.Id(FELoadPresetID).AddButton(_("Load Preset")); + mSavePreset = S.Id(FESavePresetID).AddButton(_("Save Preset")); + mDeletePreset = S.Id(FEDeletePresetID).AddButton(_("Delete Preset")); + mImportPresets = S.Id(FEImportPresetsID).AddButton(_("Import Presets")); + mExportPresets = S.Id(FEExportPresetsID).AddButton(_("Export Presets")); + } + S.EndMultiColumn(); + S.StartMultiColumn(4, wxALIGN_LEFT); + { + S.SetStretchyCol(1); + S.SetStretchyCol(3); + S.Id(FEFormatLabelID).AddFixedText(_("Format:")); + mFormatName = S.Id(FEFormatNameID).AddVariableText(wxT("")); + S.Id(FECodecLabelID).AddFixedText(_("Codec:")); + mCodecName = S.Id(FECodecNameID).AddVariableText(wxT("")); + } + S.EndMultiColumn(); + S.AddVariableText(_("Not all formats and codecs are compatible. Nor are all option combinations compatible with all codecs."), false); + S.StartMultiColumn(2, wxEXPAND); + { + S.StartMultiColumn(2, wxEXPAND); + { + S.SetStretchyRow(1); + S.Id(FEAllFormatsID).AddButton(_("Show All Formats")); + S.Id(FEAllCodecsID).AddButton(_("Show All Codecs")); + mFormatList = S.Id(FEFormatID).AddListBox(&mFormatNames); + mFormatList->DeselectAll(); + mCodecList = S.Id(FECodecID).AddListBox(&mCodecNames); + mCodecList->DeselectAll(); + } + S.EndMultiColumn(); + S.StartVerticalLay(); + { + //S.StartScroller( ); + S.SetBorder( 3 ); + S.StartStatic(_("General Options"), 0); + { + S.StartMultiColumn(8, wxEXPAND); + { + mLanguageText = S.Id(FELanguageID).TieTextBox(_("Language:"), wxT("/FileFormats/FFmpegLanguage"), wxEmptyString, 9); + mLanguageText->SetToolTip(_("ISO 639 3-letter language code\nOptional\nempty - automatic")); + + S.AddSpace( 20,0 ); + S.AddVariableText(_("Bit Reservoir")); + S.Id(FEBitReservoirID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegBitReservoir"), true); + + S.AddSpace( 20,0 ); + S.AddVariableText(_("VBL")); + S.Id(FEVariableBlockLenID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegVariableBlockLen"), true); + } + S.EndMultiColumn(); + S.StartMultiColumn(4, wxALIGN_LEFT); + { + mTag = S.Id(FETagID).TieTextBox(_("Tag:"), wxT("/FileFormats/FFmpegTag"), wxEmptyString, 4); + mTag->SetToolTip(_("Codec tag (FOURCC)\nOptional\nempty - automatic")); + + mBitrateSpin = S.Id(FEBitrateID).TieSpinCtrl(_("Bit Rate:"), wxT("/FileFormats/FFmpegBitRate"), 0, 1000000, 0); + mBitrateSpin->SetToolTip(_("Bit Rate (bits/second) - influences the resulting file size and quality\nSome codecs may only accept specific values (128k, 192k, 256k etc)\n0 - automatic\nRecommended - 192000")); + + mQualitySpin = S.Id(FEQualityID).TieSpinCtrl(_("Quality:"), wxT("/FileFormats/FFmpegQuality"), 0, 500, -1); + mQualitySpin->SetToolTip(_("Overall quality, used differently by different codecs\nRequired for vorbis\n0 - automatic\n-1 - off (use bitrate instead)")); + + mSampleRateSpin = S.Id(FESampleRateID).TieSpinCtrl(_("Sample Rate:"), wxT("/FileFormats/FFmpegSampleRate"), 0, 200000, 0); + mSampleRateSpin->SetToolTip(_("Sample rate (Hz)\n0 - don't change sample rate")); + + mCutoffSpin = S.Id(FECutoffID).TieSpinCtrl(_("Cutoff:"), wxT("/FileFormats/FFmpegCutOff"), 0, 10000000, 0); + mCutoffSpin->SetToolTip(_("Audio cutoff bandwidth (Hz)\nOptional\n0 - automatic")); + + mProfileChoice = S.Id(FEProfileID).TieChoice(_("Profile:"), wxT("/FileFormats/FFmpegAACProfile"), + mProfileLabels[0], mProfileNames, mProfileLabels); + mProfileChoice->SetSizeHints( 100,-1); + mProfileChoice->SetToolTip(_("AAC Profile\nLow Complexity -default\nMost players won't play anything other than LC")); + + } + S.EndMultiColumn(); + } + S.EndStatic(); + S.StartStatic(_("FLAC options"),0); + { + S.StartMultiColumn(4, wxALIGN_LEFT); + { + mCompressionLevelSpin = S.Id(FECompLevelID).TieSpinCtrl(_("Compression:"), wxT("/FileFormats/FFmpegCompLevel"), 0, 10, -1); + mCompressionLevelSpin->SetToolTip(_("Compression level\nRequired for FLAC\n-1 - automatic\nmin - 0 (fast encoding, large output file)\nmax - 10 (slow encoding, small output file)")); + + mFrameSizeSpin = S.Id(FEFrameSizeID).TieSpinCtrl(_("Frame:"), wxT("/FileFormats/FFmpegFrameSize"), 0, 65535, 0); + mFrameSizeSpin->SetToolTip(_("Frame size\nOptional\n0 - default\nmin - 16\nmax - 65535")); + + mLPCCoeffsPrecisionSpin = S.Id(FELPCCoeffsID).TieSpinCtrl(_("LPC"), wxT("/FileFormats/FFmpegLPCCoefPrec"), 0, 15, 0); + mLPCCoeffsPrecisionSpin->SetToolTip(_("LPC coefficients precision\nOptional\n0 - default\nmin - 1\nmax - 15")); + + mPredictionOrderMethodChoice = S.Id(FEPredOrderID).TieChoice(_("PdO Method:"), wxT("/FileFormats/FFmpegPredOrderMethod"), + mPredictionOrderMethodLabels[4], mPredictionOrderMethodNames, mPredictionOrderMethodLabels); + mPredictionOrderMethodChoice->SetSizeHints( 100,-1); + mPredictionOrderMethodChoice->SetToolTip(_("Prediction Order Method\nEstimate - fastest, lower compression\nLog search - slowest, best compression\nFull search - default")); + + mMinPredictionOrderSpin = S.Id(FEMinPredID).TieSpinCtrl(_("Min. PdO"), wxT("/FileFormats/FFmpegMinPredOrder"), -1, 32, -1); + mMinPredictionOrderSpin->SetToolTip(_("Minimal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); + + mMaxPredictionOrderSpin = S.Id(FEMaxPredID).TieSpinCtrl(_("Max. PdO"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1, 32, -1); + mMaxPredictionOrderSpin->SetToolTip(_("Maximal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)")); + + mMinPartitionOrderSpin = S.Id(FEMinPartOrderID).TieSpinCtrl(_("Min. PtO"), wxT("/FileFormats/FFmpegMinPartOrder"), -1, 8, -1); + mMinPartitionOrderSpin->SetToolTip(_("Minimal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); + + mMaxPartitionOrderSpin = S.Id(FEMaxPartOrderID).TieSpinCtrl(_("Max. PtO"), wxT("/FileFormats/FFmpegMaxPredOrder"), -1, 8, -1); + mMaxPartitionOrderSpin->SetToolTip(_("Maximal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8")); + + S.AddVariableText(_("Use LPC")); + S.Id(FEUseLPCID).TieCheckBox(wxEmptyString, wxT("/FileFormats/FFmpegUseLPC"), true); + } + S.EndMultiColumn(); + } + S.EndStatic(); + S.StartStatic(_("MPEG container options"),0); + { + S.StartMultiColumn(4, wxALIGN_LEFT); + { + /* i18n-hint: 'mux' is short for multiplexor, a device that selects between several inputs + 'Mux Rate' is a parameter that has some bearing on compression ratio for MPEG + it has a hard to predict effect on the degree of compression */ + mMuxRate = S.Id(FEMuxRateID).TieSpinCtrl(_("Mux Rate:"), wxT("/FileFormats/FFmpegMuxRate"), 0, 10000000, 0); + mMuxRate->SetToolTip(_("Maximum bit rate of the multiplexed stream\nOptional\n0 - default")); + + /* i18n-hint: 'Packet Size' is a parameter that has some bearing on compression ratio for MPEG + compression. It measures how big a chunk of audio is compressed in one piece. */ + mPacketSize = S.Id(FEPacketSizeID).TieSpinCtrl(_("Packet Size:"), wxT("/FileFormats/FFmpegPacketSize"), 0, 10000000, 0); + mPacketSize->SetToolTip(_("Packet size\nOptional\n0 - default")); + } + S.EndMultiColumn(); + } + S.EndStatic(); + //S.EndScroller(); + S.SetBorder( 5 ); + S.AddStandardButtons(); + } + S.EndVerticalLay(); + } + S.EndMultiColumn(); } S.EndMultiColumn(); S.EndVerticalLay(); @@ -1506,7 +1495,7 @@ /// /// -int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, CodecID id) +int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID id) { // By default assume that id is not in the list int index = -1; @@ -1524,16 +1513,16 @@ { // Format is found in the list found = 1; - if (CompatibilityList[i].codec == CODEC_ID_NONE) + if (CompatibilityList[i].codec == AV_CODEC_ID_NONE) { - // Format is found in the list and it is compatible with CODEC_ID_NONE (means that it is compatible to anything) + // Format is found in the list and it is compatible with AV_CODEC_ID_NONE (means that it is compatible to anything) found = 2; break; } // Find the codec, that is claimed to be compatible AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec); // If it exists, is audio and has encoder - if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode) + if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec)) { // If it was selected - remember it's new index if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount(); @@ -1548,7 +1537,7 @@ AVCodec *codec = NULL; while ((codec = av_codec_next(codec))) { - if (codec->type == CODEC_TYPE_AUDIO && codec->encode) + if (codec->type == AVMEDIA_TYPE_AUDIO && av_codec_is_encoder(codec)) { if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0) { @@ -1568,7 +1557,7 @@ if (format != NULL) { AVCodec *codec = avcodec_find_encoder(format->audio_codec); - if (codec != NULL && (codec->type == CODEC_TYPE_AUDIO) && codec->encode) + if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec)) { if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount(); mShownCodecNames.Add(wxString::FromUTF8(codec->name)); @@ -1584,7 +1573,7 @@ /// /// -int ExportFFmpegOptions::FetchCompatibleFormatList(CodecID id, wxString *selfmt) +int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfmt) { int index = -1; mShownFormatNames.Clear(); @@ -1596,7 +1585,7 @@ // Find all formats compatible to this codec in compatibility list for (int i = 0; CompatibilityList[i].fmt != NULL; i++) { - if (CompatibilityList[i].codec == id || CompatibilityList[i].codec == CODEC_ID_NONE) + if (CompatibilityList[i].codec == id || CompatibilityList[i].codec == AV_CODEC_ID_NONE) { if ((selfmt != NULL) && (selfmt->Cmp(CompatibilityList[i].fmt) == 0)) index = mShownFormatNames.GetCount(); FromList.Add(CompatibilityList[i].fmt); @@ -1778,7 +1767,7 @@ { bool codec = false; bool format = false; - if (apptable[i].codec == CODEC_ID_NONE) codec = true; + if (apptable[i].codec == AV_CODEC_ID_NONE) codec = true; else if (cdc != NULL && apptable[i].codec == cdc->id) codec = true; if (!wxString::FromUTF8(apptable[i].format).Cmp(wxT("any"))) format = true; else if (selfmt != NULL && selfmt->Cmp(wxString::FromUTF8(apptable[i].format)) == 0) format = true; @@ -1824,7 +1813,7 @@ selcdcid = cdc->id; } } - int newselcdc = FetchCompatibleCodecList(selfmt->c_str(), (CodecID)selcdcid); + int newselcdc = FetchCompatibleCodecList(selfmt->c_str(), (AVCodecID)selcdcid); if (newselcdc >= 0) mCodecList->Select(newselcdc); AVCodec *cdc = NULL; @@ -1898,7 +1887,7 @@ { int selcdc = mCodecList->GetSelection(); int selfmt = mFormatList->GetSelection(); - if (selcdc > -1) gPrefs->Write(wxT("/FileFormats/FFmpegCodec"),(long)avcodec_find_encoder_by_name(mCodecList->GetString(selcdc).ToUTF8())->id); + if (selcdc > -1) gPrefs->Write(wxT("/FileFormats/FFmpegCodec"),mCodecList->GetString(selcdc)); if (selfmt > -1) gPrefs->Write(wxT("/FileFormats/FFmpegFormat"),mFormatList->GetString(selfmt)); gPrefs->Flush(); ShuttleGui S(this, eIsSavingToPrefs); --- a/src/export/ExportFFmpegDialogs.h +++ b/src/export/ExportFFmpegDialogs.h @@ -22,7 +22,7 @@ /// Identifiers for pre-set export types. -enum FFmpegExposedFormat +enum FFmpegExposedFormat { FMT_M4A, FMT_AC3, @@ -43,7 +43,7 @@ int canmetadata; //!< !=0 if format supports metadata, -1 any avformat version, otherwise version support added bool canutf8; //!< true if format supports metadata in UTF-8, false otherwise const wxChar *description; //!< format description (will be shown in export dialog) - CodecID codecid; //!< codec ID (see libavcodec/avcodec.h) + AVCodecID codecid; //!< codec ID (see libavcodec/avcodec.h) bool compiledIn; //!< support for this codec/format is compiled in (checked at runtime) }; @@ -52,7 +52,7 @@ struct CompatibilityEntry { const wxChar *fmt; //!< format, recognizeable by guess_format() - CodecID codec; //!< codec ID + AVCodecID codec; //!< codec ID }; @@ -148,7 +148,7 @@ { bool enable; //!< true if this control should be enabled, false otherwise int control; //!< control ID - CodecID codec; //!< Codec ID + AVCodecID codec; //!< Codec ID const char *format; //!< Format short name }; @@ -237,7 +237,7 @@ wxButton *mDeletePreset; wxButton *mImportPresets; wxButton *mExportPresets; - + int mBitRateFromChoice; int mSampleRateFromChoice; @@ -247,7 +247,7 @@ /// Finds the format currently selected and returns it's name and description void FindSelectedFormat(wxString **name, wxString **longname); - + /// Finds the codec currently selected and returns it's name and description void FindSelectedCodec(wxString **name, wxString **longname); @@ -258,7 +258,7 @@ ///\param id Codec ID ///\param selfmt format selected at the moment ///\return index of the selfmt in new format list or -1 if it is not in the list - int FetchCompatibleFormatList(CodecID id, wxString *selfmt); + int FetchCompatibleFormatList(AVCodecID id, wxString *selfmt); /// Retreives codec list from libavcodec void FetchCodecList(); @@ -267,7 +267,7 @@ ///\param fmt Format short name ///\param id id of the codec selected at the moment ///\return index of the id in new codec list or -1 if it is not in the list - int FetchCompatibleCodecList(const wxChar *fmt, CodecID id); + int FetchCompatibleCodecList(const wxChar *fmt, AVCodecID id); /// Retreives list of presets from configuration file void FetchPresetList(); @@ -275,7 +275,7 @@ // Enables/disables controls based on format/codec combination, // leaving only relevant controls enabled. // Hiding the controls may have been a better idea, - // but it's hard to hide their text labels too + // but it's hard to hide their text labels too void EnableDisableControls(AVCodec *cdc, wxString *selfmt); DECLARE_EVENT_TABLE() }; --- a/src/import/ImportFFmpeg.cpp +++ b/src/import/ImportFFmpeg.cpp @@ -37,7 +37,7 @@ //TODO: remove non-audio extensions #if defined(USE_FFMPEG) static const wxChar *exts[] = -{ +{ wxT("4xm"), wxT("MTV"), wxT("roq"), @@ -171,7 +171,7 @@ FFmpegImportPlugin(): ImportPlugin(wxArrayString(WXSIZEOF(exts),exts)) { - + } ~FFmpegImportPlugin() { } @@ -210,23 +210,23 @@ ///! Reads next audio frame ///\return pointer to the stream context structure to which the frame belongs to or NULL on error, or 1 if stream is not to be imported. streamContext* ReadNextFrame(); - + ///! Decodes the frame ///\param sc - stream context (from ReadNextFrame) ///\param flushing - true if flushing (no more frames left), false otherwise ///\return 0 on success, -1 if it can't decode any further int DecodeFrame(streamContext *sc, bool flushing); - + ///! Writes decoded data into WaveTracks. Called by DecodeFrame ///\param sc - stream context ///\return 0 on success, 1 on error or interruption int WriteData(streamContext *sc); - + ///! Writes extracted metadata to tags object ///\param avf - file context ///\ tags - Audacity tags object void WriteMetadata(Tags *tags); - + ///! Retrieves metadata from FFmpeg and converts to wxString ///\param avf - file context ///\ tags - Audacity tags object @@ -240,7 +240,7 @@ { return mNumStreams; } - + ///! Called by Import.cpp ///\return array of strings - descriptions of the streams wxArrayString *GetStreamInfo() @@ -263,7 +263,7 @@ int mNumStreams; //!< mNumstreams is less or equal to mFormatContext->nb_streams streamContext **mScs; //!< Array of pointers to stream contexts. Length is mNumStreams. wxArrayString *mStreamInfo; //!< Array of stream descriptions. Length is mNumStreams - + wxInt64 mProgressPos; //!< Current timestamp, file position or whatever is used as first argument for Update() wxInt64 mProgressLen; //!< Duration, total length or whatever is used as second argument for Update() @@ -317,7 +317,7 @@ dlg = new FFmpegNotFoundDialog(NULL); dlg->ShowModal(); delete dlg; - } + } } } if (!FFmpegLibsInst->ValidLibsLoaded()) @@ -326,7 +326,7 @@ return NULL; } - // Open the file for import + // Open the file for import bool success = handle->Init(); if (!success) { delete handle; @@ -369,10 +369,10 @@ return false; } - err = av_find_stream_info(mFormatContext); + err = avformat_find_stream_info(mFormatContext, NULL); if (err < 0) { - wxLogError(wxT("FFmpeg : av_find_stream_info() failed for file %s"),mName.c_str()); + wxLogError(wxT("FFmpeg: avformat_find_stream_info() failed for file %s"),mName.c_str()); return false; } @@ -388,7 +388,7 @@ // Fill the stream contexts for (unsigned int i = 0; i < mFormatContext->nb_streams; i++) { - if (mFormatContext->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) + if (mFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { //Create a context streamContext *sc = new streamContext; @@ -413,7 +413,7 @@ continue; } - if (avcodec_open(sc->m_codecCtx, codec) < 0) + if (avcodec_open2(sc->m_codecCtx, codec, NULL) < 0) { wxLogError(wxT("FFmpeg : avcodec_open() failed. Index[%02d], Codec[%02x - %s]"),i,sc->m_codecCtx->codec_id,sc->m_codecCtx->codec_name); //Can't open decoder - skip this stream @@ -425,16 +425,16 @@ wxString strinfo; int duration = 0; if (sc->m_stream->duration > 0) - duration = sc->m_stream->duration * sc->m_stream->time_base.num / sc->m_stream->time_base.den; + duration = sc->m_stream->duration * sc->m_stream->time_base.num / sc->m_stream->time_base.den; else - duration = mFormatContext->duration / AV_TIME_BASE; + duration = mFormatContext->duration / AV_TIME_BASE; wxString bitrate = wxT(""); if (sc->m_codecCtx->bit_rate > 0) - bitrate.Printf(wxT("%d"),sc->m_codecCtx->bit_rate); + bitrate.Printf(wxT("%d"),sc->m_codecCtx->bit_rate); else - bitrate.Printf(wxT("?")); + bitrate.Printf(wxT("?")); - AVMetadataTag *tag = av_metadata_get(sc->m_stream->metadata, "language", NULL, 0); + AVDictionaryEntry *tag = av_dict_get(sc->m_stream->metadata, "language", NULL, 0); wxString lang; if (tag) { @@ -491,8 +491,10 @@ { switch (mScs[s]->m_stream->codec->sample_fmt) { - case SAMPLE_FMT_U8: - case SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_U8: + case AV_SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_U8P: + case AV_SAMPLE_FMT_S16P: mScs[s]->m_osamplesize = sizeof(int16_t); mScs[s]->m_osamplefmt = int16Sample; break; @@ -574,24 +576,24 @@ sampleDuration = ((sampleCount)mFormatContext->duration *mScs[s]->m_stream->codec->sample_rate) / AV_TIME_BASE; // printf(" OD duration samples %qi, sr %d, secs %d\n",sampleDuration, (int)mScs[s]->m_stream->codec->sample_rate,(int)sampleDuration/mScs[s]->m_stream->codec->sample_rate); - + //for each wavetrack within the stream add coded blockfiles for (int c = 0; c < mScs[s]->m_stream->codec->channels; c++) { WaveTrack *t = mChannels[s][c]; odTask->AddWaveTrack(t); - + sampleCount maxBlockSize = t->GetMaxBlockSize(); //use the maximum blockfile size to divide the sections (about 11secs per blockfile at 44.1khz) for (sampleCount i = 0; i < sampleDuration; i += maxBlockSize) { sampleCount blockLen = maxBlockSize; if (i + blockLen > sampleDuration) blockLen = sampleDuration - i; - + t->AppendCoded(mFilename, i, blockLen, c,ODTask::eODFFMPEG); - - // This only works well for single streams since we assume + + // This only works well for single streams since we assume // each stream is of the same duration and channels - res = mProgress->Update(i+sampleDuration*c+ sampleDuration*mScs[s]->m_stream->codec->channels*s, + res = mProgress->Update(i+sampleDuration*c+ sampleDuration*mScs[s]->m_stream->codec->channels*s, sampleDuration*mScs[s]->m_stream->codec->channels*mNumStreams); if (res != eProgressSuccess) break; @@ -634,7 +636,7 @@ { av_free_packet(&sc->m_pkt); sc->m_pktValid = 0; - } + } } } @@ -651,7 +653,7 @@ { av_free_packet(&mScs[i]->m_pkt); mScs[i]->m_pktValid = 0; - } + } } } } @@ -749,23 +751,28 @@ { switch (sc->m_samplefmt) { - case SAMPLE_FMT_U8: + case AV_SAMPLE_FMT_U8: + case AV_SAMPLE_FMT_U8P: ((int16_t *)tmp[chn])[index] = (int16_t) (*(uint8_t *)in - 0x80) << 8; break; - - case SAMPLE_FMT_S16: + + case AV_SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_S16P: ((int16_t *)tmp[chn])[index] = (int16_t) *(int16_t *)in; break; - - case SAMPLE_FMT_S32: + + case AV_SAMPLE_FMT_S32: + case AV_SAMPLE_FMT_S32P: ((float *)tmp[chn])[index] = (float) *(int32_t *)in * (1.0 / (1 << 31)); break; - - case SAMPLE_FMT_FLT: + + case AV_SAMPLE_FMT_FLT: + case AV_SAMPLE_FMT_FLTP: ((float *)tmp[chn])[index] = (float) *(float *)in; break; - - case SAMPLE_FMT_DBL: + + case AV_SAMPLE_FMT_DBL: + case AV_SAMPLE_FMT_DBLP: ((float *)tmp[chn])[index] = (float) *(double *)in; break; @@ -789,9 +796,10 @@ } free(tmp); - + // Try to update the progress indicator (and see if user wants to cancel) int updateResult = eProgressSuccess; + int64_t filesize = avio_size(mFormatContext->pb); // PTS (presentation time) is the proper way of getting current position if (sc->m_pkt.pts != int64_t(AV_NOPTS_VALUE) && mFormatContext->duration != int64_t(AV_NOPTS_VALUE)) { @@ -805,10 +813,10 @@ mProgressLen = sc->m_stream->nb_frames; } // When number of frames is unknown, use position in file - else if (mFormatContext->file_size > 0 && sc->m_pkt.pos > 0 && sc->m_pkt.pos <= mFormatContext->file_size) + else if (filesize > 0 && sc->m_pkt.pos > 0 && sc->m_pkt.pos <= filesize) { mProgressPos = sc->m_pkt.pos; - mProgressLen = mFormatContext->file_size; + mProgressLen = filesize; } updateResult = mProgress->Update(mProgressPos, mProgressLen != 0 ? mProgressLen : 1); @@ -831,9 +839,9 @@ void FFmpegImportFileHandle::GetMetadata(Tags *tags, const wxChar *tag, const char *name) { - AVMetadataTag *meta; + AVDictionaryEntry *meta; - meta = av_metadata_get(mFormatContext->metadata, name, NULL, AV_METADATA_IGNORE_SUFFIX); + meta = av_dict_get(mFormatContext->metadata, name, NULL, AV_DICT_IGNORE_SUFFIX); if (meta) { tags->SetTag(tag, wxString::FromUTF8(meta->value)); @@ -850,7 +858,7 @@ #endif if (FFmpegLibsInst->ValidLibsLoaded()) { - if (mFormatContext) av_close_input_file(mFormatContext); + if (mFormatContext) avformat_close_input(&mFormatContext); av_log_set_callback(av_log_default_callback); } debian/patches/fix-ladspa-search-path.patch0000664000000000000000000000210412342434354016066 0ustar Description: Fix default LADSPA search paths on Linux. The default LADSPA search paths should be /home//.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa according to http://www.ladspa.org/ladspa_sdk/shared_plugins.html . Additional search in the ladspa subdirectory of the system library directory (which could be /usr/lib/x86_64-linux-gnu/ on Debian, for example). Author: Benjamin Drung Bug-Debian: http://bugs.debian.org/724836 Bug-Ubuntu: https://launchpad.net/bugs/1261654 --- a/src/effects/ladspa/LoadLadspa.cpp +++ b/src/effects/ladspa/LoadLadspa.cpp @@ -286,8 +286,9 @@ wxGetApp().AddMultiPathsToPathList(pathVar, pathList); #ifdef __WXGTK__ - wxGetApp().AddUniquePathToPathList(wxT(INSTALL_PREFIX) wxT("/ladspa"), pathList); + wxGetApp().AddUniquePathToPathList(wxT("~/.ladspa"), pathList); wxGetApp().AddUniquePathToPathList(wxT("/usr/local/lib/ladspa"), pathList); + wxGetApp().AddUniquePathToPathList(wxT("/usr/lib/ladspa"), pathList); wxGetApp().AddUniquePathToPathList(wxT(LIBDIR) wxT("/ladspa"), pathList); #endif debian/audacity-data.install0000664000000000000000000000020312344156711013271 0ustar usr/share/audacity usr/share/icons usr/share/locale usr/share/mime usr/share/pixmaps/gnome-mime-application-x-audacity-project.xpm debian/source/0000775000000000000000000000000012231441137010466 5ustar debian/source/format0000664000000000000000000000001412231441137011674 0ustar 3.0 (quilt) debian/audacity.menu0000664000000000000000000000037612231441137011665 0ustar ?package(audacity):needs="X11" section="Applications/Sound" \ title="Audacity" command="/usr/bin/audacity" \ icon="/usr/share/pixmaps/audacity32.xpm" \ icon32x32="/usr/share/pixmaps/audacity32.xpm" \ icon16x16="/usr/share/pixmaps/audacity16.xpm" debian/audacity.mime0000664000000000000000000000145612231441137011650 0ustar application/ogg; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/basic; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/mpeg; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/x-aiff; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/x-mp3; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/x-wav; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 application/x-flac; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 audio/x-flac; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 application/x-audacity-project; audacity '%s'; edit=audacity '%s'; test=test "$DISPLAY" != ""; priority=2 debian/copyright0000664000000000000000000002542512344156711011137 0ustar Audacity: A Free, Cross-Platform Digital Audio Editor Original sources from: http://sourceforge.net/project/showfiles.php?group_id=6235 This Debian package was created by Joshua Haberman, and is now maintained by Matt Brubeck. Below is a list of the upstream authors. ------------------------------------------------------------- Lead Developers: Dominic Mazzoni Joshua Haberman Matt Brubeck Developers: Brian Gunlogson Shane Mueller Vaughan Johnson Greg Mekkes Vince Busam Augustus Saunders Tony Oetzmann Paul Nasca Roger Dannenberg Other Contributors: Dave Beydler Jason Cohen Steve Harris Daniil Kolpakov Robert Leidle Logan Lewis Jason Pepas Mark Phillips Jonathan Ryshpan Patrick Shirkey Mark Tomlinson David Topper Rudy Trubitt The Audacity Logo: Harvey Lubin http://www.agrapha.com/ ------------------------------------------------------------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (in a file called LICENSE.txt); if not, go to http://www.gnu.org/copyleft/gpl.html or write to Free Software Foundation, Inc. 51 Franklin St, Fifth Floor Boston, MA 02110-1301, USA. On Debian systems, the text of the GPL is available in the file: /usr/share/common-licenses/GPL-2 ------------------------------------------------------------- The Audacity source package also contains code from the following libraries, which are available under free, GPL-compatible licenses: * expat * libresample * Nyquist * PortAudio * PortMixer * SoundTouch * xlisp Copyright and licensing information for those libraries follows. ------------------------------------------------------------- Nyquist Copyright (c) 2000-2002, by Roger B. Dannenberg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions of source code must retain the copyright notice, the list of conditions, and the disclaimer, all three of which appear below under "COPYRIGHT AND LICENSE INFORMATION FOR XLISP." Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Redistributions in binary form must reproduce the copyright notice, the list of conditions, and the disclaimer, all three of which appear below under "COPYRIGHT AND LICENSE INFORMATION FOR XLISP," in the documentation and/or other materials provided with the distribution. Neither the name of Roger B. Dannenberg, Carnegie Mellon University, nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. COPYRIGHT AND LICENSE INFORMATION FOR XLISP (part of Nyquist): Copyright (c) 1984-2002, by David Michael Betz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of David Michael Betz nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------- PortAudio Portable Real-Time Audio Library PortAudio API Header File Latest version available at: http://www.audiomulch.com/portaudio/ Copyright (c) 1999-2000 Ross Bencina and Phil Burk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------- PortMixer Copyright (c) 2002 Written by Dominic Mazzoni PortMixer is intended to work side-by-side with PortAudio, the Portable Real-Time Audio Library by Ross Bencina and Phil Burk. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------- libresample License and warranty: All of the files in this package are Copyright 2003 by Dominic Mazzoni . This library was based heavily on Resample-1.7, Copyright 1994-2002 by Julius O. Smith III , all rights reserved. Permission to use and copy is granted subject to the terms of the "GNU Lesser General Public License" (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or any later version. In addition, Julius O. Smith III requests that a copy of any modified files be sent by email to jos@ccrma.stanford.edu so that he may incorporate them into the CCRMA version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. On Debian systems, the text of the GPL is available in the file: /usr/share/common-licenses/LGPL-2.1 ------------------------------------------------------------- expat Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------- SoundTouch sound processing library v1.01 ========================================= Copyright (c) Olli Parviainen 2002 LICENSE: ======== This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. debian/gbp.conf0000664000000000000000000000010612231441137010602 0ustar [DEFAULT] compression = xz pristine-tar = True [git-dch] meta = True