Browse Source

ffmpeg: Make read_packet return AVERROR_EOF

Newer versions of FFmpeg deprecate returning 0 to indicate
EOF, and instead request use of AVERROR_EOF.

The oldest supported versions of FFmpeg/libav will treat any
error code the same as returning 0.

Fixes #315
Sam Edwards 7 years ago
parent
commit
e4c9526e08
1 changed files with 1 additions and 1 deletions
  1. 1 1
      panda/src/ffmpeg/ffmpegVirtualFile.cxx

+ 1 - 1
panda/src/ffmpeg/ffmpegVirtualFile.cxx

@@ -209,7 +209,7 @@ read_packet(void *opaque, uint8_t *buf, int size) {
   streampos remaining = self->_start + (streampos)self->_size - in->tellg();
   if (remaining < ssize) {
     if (remaining <= 0) {
-      return 0;
+      return AVERROR_EOF;
     }
 
     ssize = remaining;