diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-06-24 16:55:59 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-06-24 16:55:59 +0000 |
| commit | 0d919a16efda7db3a76765dbcdcb7574b6b3bb33 (patch) | |
| tree | a6683343f5b9b6b53e1024b6f022cddeaf8fb223 /src/plugins/Input | |
| parent | 1ee602e514927b7a7db427c4fcbedfded19c44e0 (diff) | |
| download | qmmp-0d919a16efda7db3a76765dbcdcb7574b6b3bb33.tar.gz qmmp-0d919a16efda7db3a76765dbcdcb7574b6b3bb33.tar.bz2 qmmp-0d919a16efda7db3a76765dbcdcb7574b6b3bb33.zip | |
show codec and bitrate for IceCast streams (#1046)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9419 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Input')
| -rw-r--r-- | src/plugins/Input/aac/decoder_aac.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/Input/flac/decoder_flac.cpp | 2 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mad.cpp | 8 | ||||
| -rw-r--r-- | src/plugins/Input/mpeg/decoder_mpg123.cpp | 12 | ||||
| -rw-r--r-- | src/plugins/Input/opus/decoder_opus.cpp | 3 | ||||
| -rw-r--r-- | src/plugins/Input/vorbis/decoder_vorbis.cpp | 1 |
6 files changed, 26 insertions, 2 deletions
diff --git a/src/plugins/Input/aac/decoder_aac.cpp b/src/plugins/Input/aac/decoder_aac.cpp index 943614121..ec7b45696 100644 --- a/src/plugins/Input/aac/decoder_aac.cpp +++ b/src/plugins/Input/aac/decoder_aac.cpp @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ - #include <QObject> #include <QIODevice> #include <QtGlobal> @@ -131,6 +130,7 @@ bool DecoderAAC::initialize() memmove(m_input_buf, m_input_buf + res, m_input_at - res); m_input_at -= res; + setProperty(Qmmp::FORMAT_NAME, "AAC"); configure(freq, chan, Qmmp::PCM_S16LE); qDebug("DecoderAAC: initialize succes"); return true; diff --git a/src/plugins/Input/flac/decoder_flac.cpp b/src/plugins/Input/flac/decoder_flac.cpp index 6b854954b..cfc34a35e 100644 --- a/src/plugins/Input/flac/decoder_flac.cpp +++ b/src/plugins/Input/flac/decoder_flac.cpp @@ -391,6 +391,7 @@ bool DecoderFLAC::initialize() return false; } qDebug("DecoderFLAC: Ogg FLAC stream found"); + setProperty(Qmmp::FORMAT_NAME, "Ogg FLAC"); } else if (!memcmp(buf, "fLaC", 4)) { @@ -409,6 +410,7 @@ bool DecoderFLAC::initialize() return false; } qDebug("DecoderFLAC: native FLAC stream found"); + setProperty(Qmmp::FORMAT_NAME, "FLAC"); } else { diff --git a/src/plugins/Input/mpeg/decoder_mad.cpp b/src/plugins/Input/mpeg/decoder_mad.cpp index 4e984db58..f6645119d 100644 --- a/src/plugins/Input/mpeg/decoder_mad.cpp +++ b/src/plugins/Input/mpeg/decoder_mad.cpp @@ -356,6 +356,14 @@ bool DecoderMAD::findHeader() m_freq = header.samplerate; m_channels = MAD_NCHANNELS(&header); m_bitrate = header.bitrate / 1000; + + if((header.flags & MAD_FLAG_LSF_EXT) && (header.flags & MAD_FLAG_MPEG_2_5_EXT)) + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-2.5 layer %1").arg(header.layer)); + else if(header.flags & MAD_FLAG_LSF_EXT) + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-2 layer %1").arg(header.layer)); + else + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-1 layer %1").arg(header.layer)); + mad_header_finish(&header); input()->seek(0); m_input_bytes = 0; diff --git a/src/plugins/Input/mpeg/decoder_mpg123.cpp b/src/plugins/Input/mpeg/decoder_mpg123.cpp index a9a6ca62e..e359f455d 100644 --- a/src/plugins/Input/mpeg/decoder_mpg123.cpp +++ b/src/plugins/Input/mpeg/decoder_mpg123.cpp @@ -143,7 +143,19 @@ bool DecoderMPG123::initialize() m_totalTime = (qint64) mpg123_length(m_handle) * 1000 / m_rate; } else + { + if((err = mpg123_info(m_handle, &m_frame_info)) != MPG123_OK) + qWarning("DecoderMPG123: mpg123 error: %s", mpg123_plain_strerror(err)); + + if(m_frame_info.version == MPG123_1_0) + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-1 layer %1").arg(m_frame_info.layer)); + else if(m_frame_info.version == MPG123_2_0) + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-2 layer %1").arg(m_frame_info.layer)); + else if(m_frame_info.version == MPG123_2_5) + setProperty(Qmmp::FORMAT_NAME, QString("MPEG-2.5 layer %1").arg(m_frame_info.layer)); + m_totalTime = 0; + } configure(m_rate, channels, Qmmp::PCM_FLOAT); return true; diff --git a/src/plugins/Input/opus/decoder_opus.cpp b/src/plugins/Input/opus/decoder_opus.cpp index 3f0c11dd2..5a6ffdb78 100644 --- a/src/plugins/Input/opus/decoder_opus.cpp +++ b/src/plugins/Input/opus/decoder_opus.cpp @@ -119,7 +119,7 @@ bool DecoderOpus::initialize() return false; } - m_chan = head->channel_count; + m_chan = head->channel_count; ChannelMap chmap = findChannelMap(m_chan); if(chmap.isEmpty()) @@ -127,6 +127,7 @@ bool DecoderOpus::initialize() qWarning("DecoderOpus: unsupported number of channels: %d", m_chan); return false; } + setProperty(Qmmp::FORMAT_NAME, "Ogg Opus"); configure(48000, chmap, Qmmp::PCM_FLOAT); //opus codec supports 48 kHz only return true; } diff --git a/src/plugins/Input/vorbis/decoder_vorbis.cpp b/src/plugins/Input/vorbis/decoder_vorbis.cpp index 726dfe634..bcf051c04 100644 --- a/src/plugins/Input/vorbis/decoder_vorbis.cpp +++ b/src/plugins/Input/vorbis/decoder_vorbis.cpp @@ -123,6 +123,7 @@ bool DecoderVorbis::initialize() freq = ogginfo->rate; chan = ogginfo->channels; setProperty(Qmmp::BITRATE, int(ogginfo->bitrate_nominal / 1000)); + setProperty(Qmmp::FORMAT_NAME, "Ogg Vorbis"); } ChannelMap chmap = findChannelMap(chan); |
