summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2011-05-04 17:33:03 +0300
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2011-05-06 13:23:45 +0200
commit920bfb0da20f939f13b1742946af8fa3253723a9 (patch)
tree7663ba2de7af1f025c1687b409e0911ee6ab9d5d /ext
parentcc9d778844078d0eb2c23c7a11f7f855d013bca5 (diff)
ffdec: do not try to resync to the next keyframe when late
A keyframe may be quite a while in the future, and the decoder has no way of knowing this. A poor decision could mean quite some time with no video output. This decision should be left to the upstream element: a demuxer might know about incoming keyframes, or some other element might be able to request a keyframe. Fixes bug #649372.
Diffstat (limited to 'ext')
-rw-r--r--ext/ffmpeg/gstffmpegdec.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 7f9c106..1318601 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -1380,14 +1380,7 @@ gst_ffmpegdec_do_qos (GstFFMpegDec * ffmpegdec, GstClockTime timestamp,
if (proportion < 0.4 && diff < 0) {
goto normal_mode;
} else {
- /* if we're more than two seconds late, switch to the next keyframe */
- /* FIXME, let the demuxer decide what's the best since we might be dropping
- * a lot of frames when the keyframe is far away or we even might not get a new
- * keyframe at all.. */
- if (diff > ((GstClockTimeDiff) GST_SECOND * 2)
- && !ffmpegdec->waiting_for_key) {
- goto skip_to_keyframe;
- } else if (diff >= 0) {
+ if (diff >= 0) {
/* we're too slow, try to speed up */
if (ffmpegdec->waiting_for_key) {
/* we were waiting for a keyframe, that's ok */
@@ -1414,16 +1407,6 @@ normal_mode:
}
return TRUE;
}
-skip_to_keyframe:
- {
- ffmpegdec->context->skip_frame = AVDISCARD_NONKEY;
- ffmpegdec->waiting_for_key = TRUE;
- *mode_switch = TRUE;
- GST_DEBUG_OBJECT (ffmpegdec,
- "QOS: keyframe, %" G_GINT64_FORMAT " > GST_SECOND/2", diff);
- /* we can skip the current frame */
- return FALSE;
- }
skip_frame:
{
if (ffmpegdec->context->skip_frame != AVDISCARD_NONREF) {