From 7a0c94121fc4e94745f36cae6371d140b6c4d0ef Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 7 Jun 2009 13:24:45 +0200 Subject: [PATCH] Revert "wavparse: Remove dead assignments, move variable to where it's needed." Reverts commit 44256a78f8dd79a91f3bb2ab7c3aa623c097bb8a and use the result in error reporting so that we can see what's going on. --- gst/wavparse/gstwavparse.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index e9907220c9..2aea10044b 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1142,6 +1142,7 @@ gst_waveparse_ignore_chunk (GstWavParse * wav, GstBuffer * buf, guint32 tag, static GstFlowReturn gst_wavparse_stream_headers (GstWavParse * wav) { + GstFlowReturn res; GstBuffer *buf; gst_riff_strf_auds *header = NULL; guint32 tag, size; @@ -1166,7 +1167,6 @@ gst_wavparse_stream_headers (GstWavParse * wav) buf = gst_adapter_take_buffer (wav->adapter, size); } else { - GstFlowReturn res; if ((res = gst_riff_read_chunk (GST_ELEMENT_CAST (wav), wav->sinkpad, &wav->offset, &tag, &buf)) != GST_FLOW_OK) return res; @@ -1297,8 +1297,9 @@ gst_wavparse_stream_headers (GstWavParse * wav) if (!gst_wavparse_peek_chunk_info (wav, &tag, &size)) return GST_FLOW_OK; } else { - if (gst_pad_pull_range (wav->sinkpad, wav->offset, 8, - &buf) != GST_FLOW_OK) + if ((res = + gst_pad_pull_range (wav->sinkpad, wav->offset, 8, + &buf)) != GST_FLOW_OK) goto header_read_error; tag = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf)); size = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf) + 4); @@ -1354,8 +1355,9 @@ gst_wavparse_stream_headers (GstWavParse * wav) gst_adapter_flush (wav->adapter, data_size); } else { gst_buffer_unref (buf); - if (gst_pad_pull_range (wav->sinkpad, wav->offset + 8, - data_size, &buf) != GST_FLOW_OK) + if ((res = + gst_pad_pull_range (wav->sinkpad, wav->offset + 8, + data_size, &buf)) != GST_FLOW_OK) goto header_read_error; wav->fact = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf)); gst_buffer_unref (buf); @@ -1381,8 +1383,9 @@ gst_wavparse_stream_headers (GstWavParse * wav) data_size); } else { gst_buffer_unref (buf); - if (gst_pad_pull_range (wav->sinkpad, wav->offset + 8, - data_size, &buf) != GST_FLOW_OK) + if ((res = + gst_pad_pull_range (wav->sinkpad, wav->offset + 8, + data_size, &buf)) != GST_FLOW_OK) goto header_read_error; acid = (const gst_riff_acid *) GST_BUFFER_DATA (buf); } @@ -1415,8 +1418,9 @@ gst_wavparse_stream_headers (GstWavParse * wav) ltag = GST_READ_UINT32_LE (data + 8); } else { gst_buffer_unref (buf); - if (gst_pad_pull_range (wav->sinkpad, wav->offset, 12, - &buf) != GST_FLOW_OK) + if ((res = + gst_pad_pull_range (wav->sinkpad, wav->offset, 12, + &buf)) != GST_FLOW_OK) goto header_read_error; ltag = GST_READ_UINT32_LE (GST_BUFFER_DATA (buf) + 8); } @@ -1436,8 +1440,9 @@ gst_wavparse_stream_headers (GstWavParse * wav) } else { wav->offset += 12; gst_buffer_unref (buf); - if (gst_pad_pull_range (wav->sinkpad, wav->offset, data_size, - &buf) != GST_FLOW_OK) + if ((res = + gst_pad_pull_range (wav->sinkpad, wav->offset, data_size, + &buf)) != GST_FLOW_OK) goto header_read_error; } /* parse tags */