summaryrefslogtreecommitdiffstats
path: root/ext/flac
diff options
context:
space:
mode:
authorMichael Smith <msmith@songbirdnest.com>2009-02-05 15:51:42 -0800
committerMichael Smith <msmith@songbirdnest.com>2009-02-05 15:53:04 -0800
commitdb0b8755e00bbdeed3882ad0e891462ff8b3f9b6 (patch)
tree95d88174e4d1d2eade475ff09aaedca7424628c9 /ext/flac
parentb9ca852b510d0d0486db098fbaf23641f8a54015 (diff)
flacdec: if we aborted reading, don't do into an infinite loop.
If our read callback ran out of data, so had to abort reading, we return GST_FLOW_ERROR instead of going into an infinite loop.
Diffstat (limited to 'ext/flac')
-rw-r--r--ext/flac/gstflacdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c
index abfabb2c..405a6b73 100644
--- a/ext/flac/gstflacdec.c
+++ b/ext/flac/gstflacdec.c
@@ -1530,6 +1530,13 @@ gst_flac_dec_chain (GstPad * pad, GstBuffer * buf)
GST_DEBUG_OBJECT (dec, "process_single failed");
break;
}
+
+ if (FLAC__stream_decoder_get_state (dec->stream_decoder) ==
+ FLAC__STREAM_DECODER_ABORTED) {
+ GST_WARNING_OBJECT (dec, "Read callback caused internal abort");
+ dec->last_flow = GST_FLOW_ERROR;
+ break;
+ }
}
} else if (dec->framed && got_audio_frame) {
/* framed - there should always be enough data to decode something */