summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIBM Thinklab <oblong@wall-center.(none)>2014-09-11 19:37:33 -0400
committerSebastian Dröge <sebastian@centricular.com>2014-09-12 16:26:21 +0300
commit25ab0036c0a5e35c9ddb203e9b225fdcc5d3360a (patch)
treec0d6bbb156181d9361ff4141cc06ba9c62bc3f47
parentf9db6274c28c62a22fbbffca2f156b88355fa93e (diff)
avviddec: drain frames until libav doesn't have more data
We use have_data (that comes from libav), instead of only trying 10 times, to know if there are more frames available. The old code was machine dependant as different amount of frames could be decoded by different type of (more powerful) machines, and 10 times was not always sufficient. https://bugzilla.gnome.org/show_bug.cgi?id=736515
-rw-r--r--ext/libav/gstavviddec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
index a93f3d4..a9645f2 100644
--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -1438,7 +1438,7 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
- gint have_data, len, try = 0;
+ gint have_data, len;
GST_LOG_OBJECT (ffmpegdec,
"codec has delay capabilities, calling until ffmpeg has drained everything");
@@ -1448,9 +1448,7 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
len = gst_ffmpegviddec_frame (ffmpegdec, NULL, 0, &have_data, NULL, &ret);
- if (len < 0 || have_data == 0)
- break;
- } while (try++ < 10);
+ } while (len >= 0 && have_data == 1);
avcodec_flush_buffers (ffmpegdec->context);
}
}