mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
omxaudiodec: Clean up code a bit to get rid of useless NULL checks
This commit is contained in:
parent
eba9e3f29d
commit
40ab1b0a45
1 changed files with 13 additions and 24 deletions
|
@ -991,15 +991,7 @@ gst_omx_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Handling frame");
|
GST_DEBUG_OBJECT (self, "Handling frame");
|
||||||
|
|
||||||
/* Make sure to keep a reference to the input here,
|
|
||||||
* it can be unreffed from the other thread if
|
|
||||||
* finish_frame() is called */
|
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_ref (inbuf);
|
|
||||||
|
|
||||||
if (self->downstream_flow_ret != GST_FLOW_OK) {
|
if (self->downstream_flow_ret != GST_FLOW_OK) {
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
|
||||||
return self->downstream_flow_ret;
|
return self->downstream_flow_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1012,6 +1004,11 @@ gst_omx_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
|
||||||
if (inbuf == NULL)
|
if (inbuf == NULL)
|
||||||
return gst_omx_audio_dec_drain (self);
|
return gst_omx_audio_dec_drain (self);
|
||||||
|
|
||||||
|
/* Make sure to keep a reference to the input here,
|
||||||
|
* it can be unreffed from the other thread if
|
||||||
|
* finish_frame() is called */
|
||||||
|
gst_buffer_ref (inbuf);
|
||||||
|
|
||||||
timestamp = GST_BUFFER_TIMESTAMP (inbuf);
|
timestamp = GST_BUFFER_TIMESTAMP (inbuf);
|
||||||
duration = GST_BUFFER_DURATION (inbuf);
|
duration = GST_BUFFER_DURATION (inbuf);
|
||||||
|
|
||||||
|
@ -1181,17 +1178,15 @@ gst_omx_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
|
||||||
goto release_error;
|
goto release_error;
|
||||||
}
|
}
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Passed frame to component");
|
GST_DEBUG_OBJECT (self, "Passed frame to component");
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
|
||||||
|
|
||||||
return self->downstream_flow_ret;
|
return self->downstream_flow_ret;
|
||||||
|
|
||||||
full_buffer:
|
full_buffer:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
|
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
|
||||||
|
@ -1203,7 +1198,6 @@ full_buffer:
|
||||||
flow_error:
|
flow_error:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
return self->downstream_flow_ret;
|
return self->downstream_flow_ret;
|
||||||
|
@ -1212,7 +1206,6 @@ flow_error:
|
||||||
too_large_codec_data:
|
too_large_codec_data:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL),
|
GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL),
|
||||||
|
@ -1225,7 +1218,6 @@ too_large_codec_data:
|
||||||
component_error:
|
component_error:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
|
GST_ELEMENT_ERROR (self, LIBRARY, FAILED, (NULL),
|
||||||
|
@ -1238,7 +1230,6 @@ component_error:
|
||||||
flushing:
|
flushing:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "Flushing -- returning FLUSHING");
|
GST_DEBUG_OBJECT (self, "Flushing -- returning FLUSHING");
|
||||||
|
@ -1247,7 +1238,6 @@ flushing:
|
||||||
reconfigure_error:
|
reconfigure_error:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, (NULL),
|
||||||
|
@ -1257,7 +1247,6 @@ reconfigure_error:
|
||||||
release_error:
|
release_error:
|
||||||
{
|
{
|
||||||
gst_buffer_unmap (inbuf, &minfo);
|
gst_buffer_unmap (inbuf, &minfo);
|
||||||
if (inbuf)
|
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
|
|
||||||
GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, (NULL),
|
GST_ELEMENT_ERROR (self, LIBRARY, SETTINGS, (NULL),
|
||||||
|
|
Loading…
Reference in a new issue