aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-28 15:46:53 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-11-28 15:46:53 +0000
commit26724c66d4764a77ca653ce6c0a1573e9e97e97c (patch)
treef238f84ed390de31471cb95a20e3775f2ea7e3e7 /src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
parentd02787b92ad9a220539498ebbc9f1745a075d10d (diff)
downloadqmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.tar.gz
qmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.tar.bz2
qmmp-26724c66d4764a77ca653ce6c0a1573e9e97e97c.zip
changed decoder api; fixed flac plugin
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@646 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp')
-rw-r--r--src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
index 41a968634..35abd0eac 100644
--- a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
+++ b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
@@ -20,7 +20,8 @@
#include <QtGui>
-extern "C"{
+extern "C"
+{
#if defined HAVE_FFMPEG_LIBAVFORMAT_AVFORMAT_H
#include <ffmpeg/libavformat/avformat.h>
#elif defined HAVE_FFMPEG_AVFORMAT_H
@@ -81,7 +82,7 @@ Decoder *DecoderFFmpegFactory::create(QObject *parent, QIODevice *input,
return new DecoderFFmpeg(parent, this, output, path);
}
-QList<FileInfo *> DecoderFFmpegFactory::createPlayList(const QString &fileName)
+QList<FileInfo *> DecoderFFmpegFactory::createPlayList(const QString &fileName, bool useMetaData)
{
QList <FileInfo*> list;
avcodec_init();
@@ -93,13 +94,16 @@ QList<FileInfo *> DecoderFFmpegFactory::createPlayList(const QString &fileName)
return list;
FileInfo *info = new FileInfo(fileName);
av_find_stream_info(in);
- info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(in->album).trimmed());
- info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(in->author).trimmed());
- info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(in->comment).trimmed());
- info->setMetaData(Qmmp::GENRE, QString::fromUtf8(in->genre).trimmed());
- info->setMetaData(Qmmp::TITLE, QString::fromUtf8(in->title).trimmed());
- info->setMetaData(Qmmp::YEAR, in->year);
- info->setMetaData(Qmmp::TRACK, in->track);
+ if (useMetaData)
+ {
+ info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(in->album).trimmed());
+ info->setMetaData(Qmmp::ARTIST, QString::fromUtf8(in->author).trimmed());
+ info->setMetaData(Qmmp::COMMENT, QString::fromUtf8(in->comment).trimmed());
+ info->setMetaData(Qmmp::GENRE, QString::fromUtf8(in->genre).trimmed());
+ info->setMetaData(Qmmp::TITLE, QString::fromUtf8(in->title).trimmed());
+ info->setMetaData(Qmmp::YEAR, in->year);
+ info->setMetaData(Qmmp::TRACK, in->track);
+ }
info->setLength(in->duration/AV_TIME_BASE);
av_close_input_file(in);
list << info;