diff options
author | Thiago Santos <thiagoss@osg.samsung.com> | 2015-08-15 11:31:04 -0300 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-08-15 11:31:04 -0300 |
commit | 65d2af6462e5bfb493c7a28ab2f58d7f05f64694 (patch) | |
tree | e022b96ac17e0ae9ba410d9cb4b2a7ee975e0117 /gst | |
parent | 7ab3178cc4e99d8bd7ad9691156aac5f99620f84 (diff) |
alawdec: make error handling a bit nicer
Print the element along with the debug to make it easier to trace
the failures
Diffstat (limited to 'gst')
-rw-r--r-- | gst/law/alaw-decode.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c index 5235582d2..8ef75d2db 100644 --- a/gst/law/alaw-decode.c +++ b/gst/law/alaw-decode.c @@ -120,18 +120,18 @@ gst_alaw_dec_set_format (GstAudioDecoder * dec, GstCaps * caps) structure = gst_caps_get_structure (caps, 0); if (!structure) { - GST_ERROR ("failed to get structure from caps"); - goto error_failed_get_structure; + GST_ERROR_OBJECT (dec, "failed to get structure from caps"); + return FALSE; } if (!gst_structure_get_int (structure, "rate", &rate)) { - GST_ERROR ("failed to find field rate in input caps"); - goto error_failed_find_rate; + GST_ERROR_OBJECT (dec, "failed to find field rate in input caps"); + return FALSE; } if (!gst_structure_get_int (structure, "channels", &channels)) { - GST_ERROR ("failed to find field channels in input caps"); - goto error_failed_find_channel; + GST_ERROR_OBJECT (dec, "failed to find field channels in input caps"); + return FALSE; } gst_audio_info_init (&info); @@ -140,11 +140,6 @@ gst_alaw_dec_set_format (GstAudioDecoder * dec, GstCaps * caps) GST_DEBUG_OBJECT (alawdec, "rate=%d, channels=%d", rate, channels); return gst_audio_decoder_set_output_format (dec, &info); - -error_failed_find_channel: -error_failed_find_rate: -error_failed_get_structure: - return FALSE; } static GstFlowReturn @@ -162,7 +157,7 @@ gst_alaw_dec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer) } if (!gst_buffer_map (buffer, &inmap, GST_MAP_READ)) { - GST_ERROR ("failed to map input buffer"); + GST_ERROR_OBJECT (dec, "failed to map input buffer"); goto error_failed_map_input_buffer; } @@ -173,7 +168,7 @@ gst_alaw_dec_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer) outbuf = gst_audio_decoder_allocate_output_buffer (dec, linear_size); if (!gst_buffer_map (outbuf, &outmap, GST_MAP_WRITE)) { - GST_ERROR ("failed to map input buffer"); + GST_ERROR_OBJECT (dec, "failed to map input buffer"); goto error_failed_map_output_buffer; } |