summaryrefslogtreecommitdiff
path: root/1941.patch
blob: cd5e6c7e53d6e7109f3c7dd50c7a96b95f2d187c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/apps/openmw/mwsound/ffmpeg_decoder.cpp b/apps/openmw/mwsound/ffmpeg_decoder.cpp
index 0a9641635f..997b4e30c6 100644
--- a/apps/openmw/mwsound/ffmpeg_decoder.cpp
+++ b/apps/openmw/mwsound/ffmpeg_decoder.cpp
@@ -18,11 +18,14 @@ int FFmpeg_Decoder::readPacket(void *user_data, uint8_t *buf, int buf_size)
         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;
     }
 }
 
-- 
GitLab