diff options
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 16 | ||||
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoderffmpegfactory.cpp | 3 | ||||
| -rw-r--r-- | src/plugins/Input/ffmpeg/detailsdialog.cpp | 3 |
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(); |
