diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2011-12-14 17:36:55 +0100 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2011-12-14 17:40:33 +0100 |
commit | 4b9a20b38fa00f960bf4424f150ae2ad2f9365d3 (patch) | |
tree | 552d2f8f2413c4a1fa7666a268ccee93f543e4be /ext/dts | |
parent | 9d33df291fa9cf33855e889f4a23c7f6df88b184 (diff) | |
download | gstreamer-plugins-bad-4b9a20b38fa00f960bf4424f150ae2ad2f9365d3.tar.gz |
dtsdec: avoid crashing upon draining
... and clean up some variable init and debug statement.
Diffstat (limited to 'ext/dts')
-rw-r--r-- | ext/dts/gstdtsdec.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c index 474803f59..4a304f8e8 100644 --- a/ext/dts/gstdtsdec.c +++ b/ext/dts/gstdtsdec.c @@ -492,11 +492,15 @@ gst_dtsdec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer) guint8 *data; gint size, chans; gint length = 0, flags, sample_rate, bit_rate, frame_length; - GstFlowReturn result = GST_FLOW_UNEXPECTED; + GstFlowReturn result = GST_FLOW_OK; GstBuffer *outbuf; dts = GST_DTSDEC (bdec); + /* no fancy draining */ + if (G_UNLIKELY (!buffer)) + return GST_FLOW_OK; + /* parsed stuff already, so this should work out fine */ data = GST_BUFFER_DATA (buffer); size = GST_BUFFER_SIZE (buffer); @@ -597,7 +601,8 @@ gst_dtsdec_handle_frame (GstAudioDecoder * bdec, GstBuffer * buffer) /* negotiate if required */ if (need_renegotiation) { - GST_DEBUG ("dtsdec: sample_rate:%d stream_chans:0x%x using_chans:0x%x", + GST_DEBUG_OBJECT (dts, + "dtsdec: sample_rate:%d stream_chans:0x%x using_chans:0x%x", dts->sample_rate, dts->stream_channels, dts->using_channels); if (!gst_dtsdec_renegotiate (dts)) goto failed_negotiation; |