Commit 2f7c0d21 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

flacenc/dec: Don't use GST_FLOW_IS_FATAL()

And properly handle UNEXPECTED and WRONG_STATE.
parent 0753d9fe
......@@ -1111,13 +1111,15 @@ analyze_state:
{
GST_DEBUG_OBJECT (flacdec, "everything ok");
if (GST_FLOW_IS_FATAL (flacdec->last_flow) ||
if (flacdec->last_flow < GST_FLOW_UNEXPECTED ||
flacdec->last_flow == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (flacdec, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s",
gst_flow_get_name (flacdec->last_flow)));
goto eos_and_pause;
} else if (flacdec->last_flow == GST_FLOW_UNEXPECTED) {
goto eos_and_pause;
} else if (flacdec->last_flow != GST_FLOW_OK) {
goto pause;
}
......@@ -1161,7 +1163,7 @@ analyze_state:
{
GST_INFO_OBJECT (flacdec, "read aborted: last pull_range flow = %s",
gst_flow_get_name (flacdec->pull_flow));
if (!GST_FLOW_IS_FATAL (flacdec->pull_flow)) {
if (flacdec->pull_flow == GST_FLOW_WRONG_STATE) {
/* it seems we need to flush the decoder here to reset the decoder
* state after the abort for FLAC__stream_decoder_seek_absolute()
* to work properly */
......
......@@ -1026,7 +1026,7 @@ out:
flacenc->offset += bytes;
flacenc->samples_written += samples;
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED)
if (ret != GST_FLOW_OK)
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment