Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package goldendict for openSUSE:Factory 
checked in at 2022-07-14 16:34:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/goldendict (Old)
 and      /work/SRC/openSUSE:Factory/.goldendict.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "goldendict"

Thu Jul 14 16:34:18 2022 rev:7 rq:989024 version:1.5.0~rc2+git.20220215T203220

Changes:
--------
--- /work/SRC/openSUSE:Factory/goldendict/goldendict.changes    2022-02-17 
00:31:46.781420382 +0100
+++ /work/SRC/openSUSE:Factory/.goldendict.new.1523/goldendict.changes  
2022-07-14 16:34:45.684656395 +0200
@@ -1,0 +2,7 @@
+Wed Jul 13 10:11:06 UTC 2022 - Bj??rn Lie <bjorn....@gmail.com>
+
+- Add 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05.patch and
+  7fa7ad6e529a58173d0f3f2b0b73f12a316b5cc8.patch: 
+  Fix build with ffmpeg 5, patches from upstream git.
+
+-------------------------------------------------------------------

New:
----
  7fa7ad6e529a58173d0f3f2b0b73f12a316b5cc8.patch
  8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ goldendict.spec ++++++
--- /var/tmp/diff_new_pack.QJ0EvT/_old  2022-07-14 16:34:46.232656935 +0200
+++ /var/tmp/diff_new_pack.QJ0EvT/_new  2022-07-14 16:34:46.236656938 +0200
@@ -28,6 +28,8 @@
 Version:        1.5.0~rc2+git.20220215T203220
 Release:        0
 Source0:        goldendict-%{version}.tar.xz
+Patch1:         
https://github.com/goldendict/goldendict/commit/8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05.patch
+Patch2:         
https://github.com/goldendict/goldendict/commit/7fa7ad6e529a58173d0f3f2b0b73f12a316b5cc8.patch
 
 BuildRequires:  desktop-file-utils
 BuildRequires:  gcc-c++
@@ -85,7 +87,7 @@
 %lang_package
 
 %prep
-%autosetup
+%autosetup -p1
 git init
 %if 0%{?suse_version} < 1550
   # For Qt5.12 compatibility in openSUSE Leap 15.3

++++++ 7fa7ad6e529a58173d0f3f2b0b73f12a316b5cc8.patch ++++++
>From 7fa7ad6e529a58173d0f3f2b0b73f12a316b5cc8 Mon Sep 17 00:00:00 2001
From: Igor Kushnir <igor...@gmail.com>
Date: Tue, 21 Jun 2022 16:29:05 +0300
Subject: [PATCH] FFmpeg 5.0 player: stop reading raw data at EOF

Since the update to FFmpeg 5.0, when FFmpeg+libao internal player is
selected, most sounds fail to be pronounced. Furthermore, each failed
pronunciation attempt increases GoldenDict's CPU usage. Finally,
GoldenDict continues to hang and utilize the CPU cores when the user
attempts to exit it.

The reason for the issue is: GoldenDict's readAudioData() returns 0 at
EOF but FFmpeg expects the callback to return AVERROR_EOF. As a result,
internal player's threads are busy calling readAudioData() indefinitely.

https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/a606f27f4c610708fa96e35eed7b7537d3d8f712
documented the expected return value of the read_packet callback.
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/252500a78fe1a31abc79e6070d16f50382c39343
removed the code that handled the deprecated 0 return value gracefully.

The relevant deprecation warning
"Invalid return value 0 for stream protocol" had been flooding
GoldenDict's output for years

Fixes #1489.
---
 ffmpegaudio.cc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
index 7948d2187..5b81d1022 100644
--- a/ffmpegaudio.cc
+++ b/ffmpegaudio.cc
@@ -28,6 +28,7 @@ extern "C" {
 
 #include <vector>
 
+#include "gddebug.hh"
 #include "qt4x5.hh"
 
 using std::vector;
@@ -143,7 +144,17 @@ DecoderContext::~DecoderContext()
 static int readAudioData( void * opaque, unsigned char * buffer, int 
bufferSize )
 {
   QDataStream * pStream = ( QDataStream * )opaque;
-  return pStream->readRawData( ( char * )buffer, bufferSize );
+  // This function is passed as the read_packet callback into 
avio_alloc_context().
+  // The documentation for this callback parameter states:
+  // For stream protocols, must never return 0 but rather a proper AVERROR 
code.
+  if( pStream->atEnd() )
+    return AVERROR_EOF;
+  const int bytesRead = pStream->readRawData( ( char * )buffer, bufferSize );
+  // QDataStream::readRawData() returns 0 at EOF => return AVERROR_EOF in this 
case.
+  // An error is unlikely here, so just print a warning and return AVERROR_EOF 
too.
+  if( bytesRead < 0 )
+    gdWarning( "readAudioData: error while reading raw data." );
+  return bytesRead > 0 ? bytesRead : AVERROR_EOF;
 }
 
 bool DecoderContext::openCodec( QString & errorString )

++++++ 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05.patch ++++++
>From 8acb288c9e9bdb3c6bf2e803954dd3b6ac273c05 Mon Sep 17 00:00:00 2001
From: Liao Junxuan <mike...@126.com>
Date: Sun, 20 Feb 2022 12:28:05 +0800
Subject: [PATCH] add support for ffmpeg 5.0

---
 ffmpegaudio.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
index d550f4a77..7948d2187 100644
--- a/ffmpegaudio.cc
+++ b/ffmpegaudio.cc
@@ -94,7 +94,11 @@ struct DecoderContext
   QByteArray audioData_;
   QDataStream audioDataStream_;
   AVFormatContext * formatContext_;
+#if LIBAVCODEC_VERSION_MAJOR < 59
   AVCodec * codec_;
+#else
+  const AVCodec * codec_;
+#endif
   AVCodecContext * codecContext_;
   AVIOContext * avioContext_;
   AVStream * audioStream_;

Reply via email to