From 45a91c687ea3a2ce80fcffcdea413b9dcac55242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 5 Sep 2013 02:05:52 -0600 Subject: [PATCH 02/11] gstomxvideodec: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This code doesn't seems to be used for quite a while, remove it before it starts to rot. Signed-off-by: Christian König --- omx/gstomxvideodec.c | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 0d8801e..6b5cbe3 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -1008,19 +1008,13 @@ gst_omx_video_dec_change_state (GstElement * element, GstStateChange transition) return ret; } -#define MAX_FRAME_DIST_TICKS (5 * OMX_TICKS_PER_SECOND) -#define MAX_FRAME_DIST_FRAMES (100) - static GstVideoCodecFrame * _find_nearest_frame (GstOMXVideoDec * self, GstOMXBuffer * buf) { - GList *l, *best_l = NULL; - GList *finish_frames = NULL; GstVideoCodecFrame *best = NULL; - guint64 best_timestamp = 0; guint64 best_diff = G_MAXUINT64; - BufferIdentification *best_id = NULL; GList *frames; + GList *l; frames = gst_video_decoder_get_frames (GST_VIDEO_DECODER (self)); @@ -1045,10 +1039,7 @@ _find_nearest_frame (GstOMXVideoDec * self, GstOMXBuffer * buf) if (best == NULL || diff < best_diff) { best = tmp; - best_timestamp = timestamp; best_diff = diff; - best_l = l; - best_id = id; /* For frames without timestamp we simply take the first frame */ if ((buf->omx_buf->nTimeStamp == 0 && timestamp == 0) || diff == 0) @@ -1056,43 +1047,6 @@ _find_nearest_frame (GstOMXVideoDec * self, GstOMXBuffer * buf) } } - if (FALSE && best_id) { - for (l = frames; l && l != best_l; l = l->next) { - GstVideoCodecFrame *tmp = l->data; - BufferIdentification *id = gst_video_codec_frame_get_user_data (tmp); - guint64 diff_ticks, diff_frames; - - /* This happens for frames that were just added but - * which were not passed to the component yet. Ignore - * them here! - */ - if (!id) - continue; - - if (id->timestamp > best_timestamp) - break; - - if (id->timestamp == 0 || best_timestamp == 0) - diff_ticks = 0; - else - diff_ticks = best_timestamp - id->timestamp; - diff_frames = best->system_frame_number - tmp->system_frame_number; - - if (diff_ticks > MAX_FRAME_DIST_TICKS - || diff_frames > MAX_FRAME_DIST_FRAMES) { - finish_frames = - g_list_prepend (finish_frames, gst_video_codec_frame_ref (tmp)); - } - } - } - - if (FALSE && finish_frames) { - g_warning ("Too old frames, bug in decoder -- please file a bug"); - for (l = finish_frames; l; l = l->next) { - gst_video_decoder_drop_frame (GST_VIDEO_DECODER (self), l->data); - } - } - if (best) gst_video_codec_frame_ref (best); -- 1.7.9.5