aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Input
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-04 11:51:21 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2009-05-04 11:51:21 +0000
commit2a18cf6706831bdf3cca3d4b25c0701dee46f5cc (patch)
treebd61d6f61e22c9cdd39080c4e37a0bdfa0293ee7 /src/plugins/Input
parent188532e70d8d214f6800f67eb808f8b30cb578f6 (diff)
downloadqmmp-2a18cf6706831bdf3cca3d4b25c0701dee46f5cc.tar.gz
qmmp-2a18cf6706831bdf3cca3d4b25c0701dee46f5cc.tar.bz2
qmmp-2a18cf6706831bdf3cca3d4b25c0701dee46f5cc.zip
fixed m4a support
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@931 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input')
-rw-r--r--src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp16
-rw-r--r--src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp3
-rw-r--r--src/plugins/Input/ffmpeg/detailsdialog.cpp3
3 files changed, 17 insertions, 5 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
index 12e6d16ab..678aa3ddb 100644
--- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
+++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006-2008 by Ilya Kotov *
+ * Copyright (C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -139,13 +139,23 @@ bool DecoderFFmpeg::initialize()
qDebug("DecoderFFmpeg: cannot open input file");
return FALSE;
}
+
+ av_find_stream_info(ic);
+ av_read_play(ic);
+
for (wma_idx = 0; wma_idx < ic->nb_streams; wma_idx++)
{
c = ic->streams[wma_idx]->codec;
if (c->codec_type == CODEC_TYPE_AUDIO) break;
}
- av_find_stream_info(ic);
+ if (c->channels > 0)
+ c->channels = qMin(2, c->channels);
+ else
+ c->channels = 2;
+
+ dump_format(ic,0,0,0);
+ //dump_stream_info(ic);
codec = avcodec_find_decoder(c->codec_id);
@@ -231,7 +241,7 @@ void DecoderFFmpeg::run()
out_size = 0;
- while (size > 0)
+ while (size > 0 && (pkt.stream_index == wma_idx))
{
out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*sizeof(int16_t);
l = avcodec_decode_audio2(c, (int16_t *)(wma_outbuf), &out_size, inbuf_ptr, size);
diff --git a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
index 7202fb9f8..81304eb24 100644
--- a/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
+++ b/src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008 by Ilya Kotov *
+ * Copyright (C) 2008-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -111,6 +111,7 @@ QList<FileInfo *> DecoderFFmpegFactory::createPlayList(const QString &fileName,
return list;
FileInfo *info = new FileInfo(fileName);
av_find_stream_info(in);
+ av_read_play(in);
if (useMetaData)
{
info->setMetaData(Qmmp::ALBUM, QString::fromUtf8(in->album).trimmed());
diff --git a/src/plugins/Input/ffmpeg/detailsdialog.cpp b/src/plugins/Input/ffmpeg/detailsdialog.cpp
index cf75e2e80..ce268bf8b 100644
--- a/src/plugins/Input/ffmpeg/detailsdialog.cpp
+++ b/src/plugins/Input/ffmpeg/detailsdialog.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Ilya Kotov *
+ * Copyright (C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -67,6 +67,7 @@ void DetailsDialog::loadInfo()
if (av_open_input_file(&in, m_path.toLocal8Bit(), NULL,0, NULL) < 0)
return;
av_find_stream_info(in);
+ av_read_play(in);
QString string = QString::fromUtf8(in->title).trimmed();
ui.titleLineEdit->setText(string);
string = QString::fromUtf8(in->author).trimmed();