From 687a188dade269142ebb43df3413a1c280e5e0b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 1 Mar 2013 11:44:17 +0100 Subject: [PATCH] omxvideo{dec,enc}: Don't use the input state if it wasn't set yet --- omx/gstomxvideodec.c | 5 ++--- omx/gstomxvideoenc.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index a8063a6..d2bfc7a 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -926,7 +926,6 @@ gst_omx_video_dec_get_supported_colorformats (GstOMXVideoDec * self) { GstOMXPort *port = self->dec_out_port; GstVideoCodecState *state = self->input_state; - GstVideoInfo *info = &state->info; OMX_VIDEO_PARAM_PORTFORMATTYPE param; OMX_ERRORTYPE err; GList *negotiation_map = NULL; @@ -935,10 +934,10 @@ gst_omx_video_dec_get_supported_colorformats (GstOMXVideoDec * self) GST_OMX_INIT_STRUCT (¶m); param.nPortIndex = port->index; param.nIndex = 0; - if (info->fps_n == 0) + if (!state || state->info.fps_n == 0) param.xFramerate = 0; else - param.xFramerate = (info->fps_n << 16) / (info->fps_d); + param.xFramerate = (state->info.fps_n << 16) / (state->info.fps_d); old_index = -1; do { diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 112a8ba..1fecf89 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1012,7 +1012,6 @@ gst_omx_video_enc_get_supported_colorformats (GstOMXVideoEnc * self) { GstOMXPort *port = self->enc_in_port; GstVideoCodecState *state = self->input_state; - GstVideoInfo *info = &state->info; OMX_VIDEO_PARAM_PORTFORMATTYPE param; OMX_ERRORTYPE err; GList *negotiation_map = NULL; @@ -1021,10 +1020,10 @@ gst_omx_video_enc_get_supported_colorformats (GstOMXVideoEnc * self) GST_OMX_INIT_STRUCT (¶m); param.nPortIndex = port->index; param.nIndex = 0; - if (info->fps_n == 0) + if (!state || state->info.fps_n == 0) param.xFramerate = 0; else - param.xFramerate = (info->fps_n << 16) / (info->fps_d); + param.xFramerate = (state->info.fps_n << 16) / (state->info.fps_d); old_index = -1; do { -- 2.7.4