diff -r f925d5c684fe jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.c --- a/jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.c Mon May 21 12:55:07 2012 -0700 +++ b/jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.c Mon May 21 19:28:31 2012 -0700 @@ -335,7 +335,8 @@ { GstClockTime ts = GST_BUFFER_TIMESTAMP(frame); if(GST_CLOCK_TIME_NONE == decode->previous_timestamp || - ts <= decode->previous_timestamp + decode->timestamp_ceil) + ts <= decode->previous_timestamp + decode->timestamp_ceil || + decode->skip_count > GST_SECOND/decode->frame_duration) { decode->previous_timestamp = ts; if(!GST_BUFFER_FLAG_IS_SET(frame, GST_BUFFER_FLAG_GAP)) @@ -343,9 +344,11 @@ gst_pad_push(decode->srcpad, frame); } g_queue_pop_head(decode->ordered_frames); + decode->skip_count = 0; } else { + decode->skip_count++; break; } } @@ -378,6 +381,7 @@ decode->is_initialized = FALSE; decode->is_newsegment = FALSE; decode->frame_duration = GST_CLOCK_TIME_NONE; + decode->skip_count = 0; decode->ordered_frames = g_queue_new(); } @@ -399,6 +403,8 @@ #endif } + decode->skip_count = 0; + // Unref all sorted buffers and clear the associated queue. if (NULL != decode->ordered_frames) { diff -r f925d5c684fe jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.h --- a/jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.h Mon May 21 12:55:07 2012 -0700 +++ b/jfxmedia-native/gstreamer/plugins/plugin_avcdecoder/avcdecoder.h Mon May 21 19:28:31 2012 -0700 @@ -36,6 +36,7 @@ volatile gboolean is_flushing; // element is between flush start and stop GstClockTime frame_duration; // the duration of a single video frame (nsec) + int skip_count; GQueue* ordered_frames; // decoded frames sorted into order of increasign time stamp