Commit graph

21 commits

Author SHA1 Message Date
Liao Junxuan 8acb288c9e add support for ffmpeg 5.0 2022-02-20 12:28:05 +08:00
hrimfaxi 2d2db3b208 Use libswresample to convert 32-bit and float audio into s16
Since libao+pulseaudio cannot play 32-bit or flt/fltp/dbl/dblp audio,
the following audio formats are passed through libswresample
to convert into AV_SAMPLE_FMT_S16, which is accepted by libao:

* AV_SAMPLE_FMT_S32
* AV_SAMPLE_FMT_S32P
* AV_SAMPLE_FMT_FLT
* AV_SAMPLE_FMT_FLTP
* AV_SAMPLE_FMT_DBL
* AV_SAMPLE_FMT_DBLP

This fixes issue #949 and issue #1014. Now FFmpeg+libao internal player
can play with pulseaudio backend enabled in /etc/libao.conf .

Signed-off-by: hrimfaxi <outmatch@gmail.com>
2020-07-18 22:41:57 +08:00
Abs62 966f4a8b78 FFmpeg player: Fix some crashes on broken files 2019-09-27 17:00:52 +03:00
Abs62 03bbe01b79 Fix warnings while compile with FFMpeg 3.4.2 (issue #978) 2018-03-30 23:05:22 +03:00
Igor Kushnir 9aa3c44d4e Add QMediaPlayer internal player back end (Qt5 only)
* add config and GUI support for internal player back end switching;
* make FFmpeg player disabling option consistent with other similar
  qmake options by using CONFIG;
* add a new qmake option that disables Qt Multimedia player. This is
  useful for GNU/Linux distributions where Qt WebKit and Qt Multimedia
  packages depend on different GStreamer versions and don't work
  correctly when combined in one application.

The existing FFmpeg+libao internal player back end has a relatively
low-level implementation, which is difficult to understand and improve.
There are at least 3 open internal player issues:
  1) many GNU/Linux users have to edit their libao configuration file to
     make Goldendict's internal player work (issue #412);
  2) libao's pulseaudio plugin does not support 32-bit audio, which
     means that many MediaWiki pronunciations don't work with the most
     popular GNU/Linux audio driver (issue #949);
  3) Ffmpeg::DecoderContext uses deprecated FFmpeg APIs, which causes
     compiler warnings and means that this internal player back end
     may not compile with a future FFmpeg library version (issue #978).

The Qt Multimedia back end implementation uses the highest-level
Qt audio API and is very simple.
This new back end works flawlessly on my GNU/Linux machine.
I'm not making it the default back end because I don't know how well
it will work on other platforms with different configurations.
2018-03-30 17:10:33 +03:00
Igor Kushnir e5045860ef Make adding new audio player implementations easy
* add a new interface class AudioPlayerInterface;
* inherit a new proxy class Ffmpeg::AudioPlayer from it;
* partially switch ArlticleView to using the interface;
* expose MainWindow's AudioPlayerInterface instance to all ArticleView
  instances;
* add a new AudioPlayerFactory class responsible for creating instances
  of concrete classes derived from AudioPlayerInterface depending on
  relevant Config::Preferences values;
* increase minimum supported Qt version from 4.5 to 4.6 in README
  in order to use QScopedPointer introduced in Qt 4.6.
2018-03-24 21:31:48 +02:00
Igor Kushnir 2e25be8f71 Eliminate redundant casts to/from void* in Ffmpeg player 2018-03-24 20:16:50 +02:00
Abs62 f82294b532 Merge branch 'Original' into Qt4x5 2016-02-24 17:44:26 +03:00
Abs62 cabc5aa7c3 Fix compilation with last FFMpeg versions (issue #673) 2016-02-17 17:37:23 +03:00
Abs62 89ab1bfba5 Adjust code for Qt5 2014-07-16 17:59:25 +04:00
Abs62 531aa79805 Merge branch 'Original' into Qt4x5
Conflicts:
	ffmpegaudio.cc
2014-07-16 17:58:40 +04:00
Abs62 2f8b4975a3 Fix play ADPCM wav files via internal player 2014-07-15 18:47:08 +04:00
Timon Wong 555b51260a Merge branch 'master' into qt4x5 2013-06-26 21:07:46 +08:00
Tvangeste 55e4de2cca Stop the internal audio player when the page is closed or changed 2013-06-23 11:54:46 +02:00
Timon Wong f5a43e22d4 Merge branch 'master' into qt4x5
Conflicts:
	goldendict.pro
2013-06-18 11:22:07 +08:00
Timon Wong cf71499242 Add "DISABLE_INTERNAL_PLAYER" to .pro as an option to disable internal audio player (issue #356) 2013-06-18 09:12:31 +08:00
Timon Wong 1d85f1b359 #212: Scratch, currently works under windows, for both Qt4 and Qt5 2013-05-30 21:24:21 +08:00
Timon Wong 525a539b7e FFmpeg: Fix potential crash on some codecs (speex for example) 2013-05-24 16:15:07 +08:00
Timon Wong 680c201b88 audio: localizable error string 2013-05-15 00:00:31 +08:00
Timon Wong fa1e0711b5 audio: give more meaningful error message for ao_open_live(). see #312 2013-05-14 22:24:19 +08:00
Timon Wong c4752eb14c Add internal audio player(ffmpeg/libav + libao).
* phonon, bass, playsound are removed.
2013-05-05 18:22:12 +08:00