omxvideo{dec,enc}: Don't use the input state if it wasn't set yet

This commit is contained in:
Sebastian Dröge 2013-03-01 11:44:17 +01:00
parent d92fb127ae
commit 687a188dad
2 changed files with 4 additions and 6 deletions

View file

@ -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 (&param);
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 {

View file

@ -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 (&param);
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 {