File: ffmpeg5.patch

package info (click to toggle)
openmw 0.47.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,276 kB
  • sloc: cpp: 249,935; xml: 1,978; sh: 1,327; python: 63; makefile: 26
file content (27 lines) | stat: -rw-r--r-- 861 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Description: Fix video hang with ffmpeg-5
Author: Dominique Martinet <asmadeus@codewreck.org>
Origin: upstream
Applied-Upstream: https://gitlab.com/OpenMW/openmw/-/commit/436db8c0e55b0d5be43df982d15025ed0fc76c40
Last-Update: 2022-08-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- openmw.orig/apps/openmw/mwsound/ffmpeg_decoder.cpp
+++ openmw/apps/openmw/mwsound/ffmpeg_decoder.cpp
@@ -18,11 +18,15 @@
         std::istream& stream = *static_cast<FFmpeg_Decoder*>(user_data)->mDataStream;
         stream.clear();
         stream.read((char*)buf, buf_size);
-        return stream.gcount();
+        std::streamsize count = stream.gcount();
+        if (count == 0)
+            return AVERROR_EOF;
+        return count;
+
     }
     catch (std::exception& )
     {
-        return 0;
+        return AVERROR_UNKNOWN;
     }
 }