From 1dd7b251792b8c80c67bacb9df8cb43c94d0b808 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Tue, 12 Feb 2013 11:47:44 +0000 Subject: ffmpeg plugin: cleanup git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3232 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp') diff --git a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp index 02588a92c..b8ffae9fe 100644 --- a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp +++ b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp @@ -35,6 +35,13 @@ extern "C"{ // DecoderFFmpegFactory +DecoderFFmpegFactory::DecoderFFmpegFactory() +{ + avcodec_register_all(); + avformat_network_init(); + av_register_all(); +} + bool DecoderFFmpegFactory::supports(const QString &source) const { foreach(QString filter, properties().filters) @@ -48,7 +55,6 @@ bool DecoderFFmpegFactory::supports(const QString &source) const bool DecoderFFmpegFactory::canDecode(QIODevice *i) const { - av_register_all(); QStringList filters = properties().filters; AVProbeData pd; @@ -83,7 +89,6 @@ bool DecoderFFmpegFactory::canDecode(QIODevice *i) const const DecoderProperties DecoderFFmpegFactory::properties() const { - av_register_all(); QSettings settings(Qmmp::configFile(), QSettings::IniFormat); QStringList filters; filters << "*.wma" << "*.ape"; @@ -134,9 +139,6 @@ Decoder *DecoderFFmpegFactory::create(const QString &path, QIODevice *input) QList DecoderFFmpegFactory::createPlayList(const QString &fileName, bool useMetaData) { QList list; - avcodec_register_all(); - avformat_network_init(); - av_register_all(); AVFormatContext *in = 0; if (avformat_open_input(&in,fileName.toLocal8Bit().constData(), 0, 0) < 0) -- cgit v1.2.3-13-gbd6f