summaryrefslogtreecommitdiff
path: root/gst-libs/gst/audio
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-05-26 17:44:40 +0200
committerEdward Hervey <bilboed@bilboed.com>2017-05-26 17:44:40 +0200
commit304a628de777ed0a180e8a23dc0e689ca9b0e24c (patch)
tree93cafbab3eb3bdcf7c9f31e830680e3bb6bb85f0 /gst-libs/gst/audio
parent2a193cde8481c2de6d5e7a32cfdc8eada8f9cf07 (diff)
downloadgstreamer-plugins-bad-304a628de777ed0a180e8a23dc0e689ca9b0e24c.tar.gz
nonstreamaudio: Avoid using wrong variable
And to make that 100% obvious, only use variables declared within the switch cases instead of function-wide ones. Also remove useless one-time-use-only variable. CID #1409857
Diffstat (limited to 'gst-libs/gst/audio')
-rw-r--r--gst-libs/gst/audio/gstnonstreamaudiodecoder.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gst-libs/gst/audio/gstnonstreamaudiodecoder.c b/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
index acc46804f..4889ca659 100644
--- a/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
+++ b/gst-libs/gst/audio/gstnonstreamaudiodecoder.c
@@ -1023,7 +1023,6 @@ gst_nonstream_audio_decoder_src_query (GstPad * pad, GstObject * parent,
gboolean res = FALSE;
GstNonstreamAudioDecoder *dec;
GstNonstreamAudioDecoderClass *klass;
- GstFormat format;
dec = GST_NONSTREAM_AUDIO_DECODER (parent);
klass = GST_NONSTREAM_AUDIO_DECODER_GET_CLASS (dec);
@@ -1031,6 +1030,7 @@ gst_nonstream_audio_decoder_src_query (GstPad * pad, GstObject * parent,
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_DURATION:
{
+ GstFormat format;
GST_TRACE_OBJECT (parent, "duration query");
if (!(dec->loaded_mode)) {
@@ -1064,6 +1064,7 @@ gst_nonstream_audio_decoder_src_query (GstPad * pad, GstObject * parent,
case GST_QUERY_POSITION:
{
+ GstFormat format;
if (!(dec->loaded_mode)) {
GST_DEBUG_OBJECT (parent,
"cannot respond to position query: nothing is loaded yet");
@@ -1100,13 +1101,10 @@ gst_nonstream_audio_decoder_src_query (GstPad * pad, GstObject * parent,
case GST_QUERY_SEEKING:
{
- gboolean b;
GstFormat fmt;
GstClockTime duration;
- b = dec->loaded_mode;
-
- if (!b) {
+ if (!dec->loaded_mode) {
GST_DEBUG_OBJECT (parent,
"cannot respond to seeking query: nothing is loaded yet");
break;
@@ -1132,7 +1130,7 @@ gst_nonstream_audio_decoder_src_query (GstPad * pad, GstObject * parent,
} else {
GST_DEBUG_OBJECT (parent,
"seeking query received with unsupported format %s -> can seek: no",
- gst_format_get_name (format));
+ gst_format_get_name (fmt));
gst_query_set_seeking (query, fmt, FALSE, 0, -1);
res = TRUE;
}