summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-04 01:42:39 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-04 01:42:39 +0000
commitec72668d88935635a01f602f0aa33bfa5a5c426e (patch)
treebd7ca81b4f6606b1e719116cca8b7237abe746ce /src/lib/ffmpeg_decoder.cc
parent8af00f5e0862c18e8c7b5f9ac0ea95a5d6ad696c (diff)
Ignore AVERROR_INVALIDDATA from av_read_frame() as it can apparently mean that there is still data to be processed.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index a16799e74..2d12ef0a0 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -136,14 +136,18 @@ FFmpegDecoder::pass ()
{
int r = av_read_frame (_format_context, &_packet);
- if (r < 0) {
+ /* AVERROR_INVALIDDATA can apparently be returned sometimes even when av_read_frame
+ has pretty-much succeeded (and hence generated data which should be processed).
+ Hence it makes sense to continue here in that case.
+ */
+ if (r < 0 && r != AVERROR_INVALIDDATA) {
if (r != AVERROR_EOF) {
/* Maybe we should fail here, but for now we'll just finish off instead */
char buf[256];
av_strerror (r, buf, sizeof(buf));
LOG_ERROR (N_("error on av_read_frame (%1) (%2)"), buf, r);
}
-
+
flush ();
return true;
}