diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-02-24 20:35:25 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2020-02-24 20:35:25 +0000 |
| commit | 935d82dbd0446de5071cb3be2ecfe12c9f5bca4b (patch) | |
| tree | 27d7acec2e7320238f75cd869239c42a41ea74d9 /src/plugins | |
| parent | b93b2f0a707977cdf8a71aeddcddc54532f8bcd1 (diff) | |
| download | qmmp-935d82dbd0446de5071cb3be2ecfe12c9f5bca4b.tar.gz qmmp-935d82dbd0446de5071cb3be2ecfe12c9f5bca4b.tar.bz2 qmmp-935d82dbd0446de5071cb3be2ecfe12c9f5bca4b.zip | |
ffmpeg: added opus bitrate issue workaround
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9246 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp index 948993184..986528d19 100644 --- a/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp +++ b/src/plugins/Input/ffmpeg/decoder_ffmpeg.cpp @@ -393,6 +393,12 @@ void DecoderFFmpeg::fillBuffer() if(m_pkt->size > 0) { + if(m_pkt->duration > 0 && m_codecContext->codec_id == AV_CODEC_ID_OPUS) + { + AVStream *st = m_formatContext->streams[m_audioIndex]; + m_bitrate = double(m_pkt->size) / (av_q2d(st->time_base) * m_pkt->duration) * 8.0 / 1000; + } + if(!(send_error = avcodec_send_packet(m_codecContext, m_pkt))) { av_packet_unref(m_pkt); |
