mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
flacenc/dec: Don't use GST_FLOW_IS_FATAL()
And properly handle UNEXPECTED and WRONG_STATE.
This commit is contained in:
parent
0753d9fee3
commit
2f7c0d21b6
2 changed files with 5 additions and 3 deletions
|
@ -1111,13 +1111,15 @@ analyze_state:
|
||||||
{
|
{
|
||||||
GST_DEBUG_OBJECT (flacdec, "everything ok");
|
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) {
|
flacdec->last_flow == GST_FLOW_NOT_LINKED) {
|
||||||
GST_ELEMENT_ERROR (flacdec, STREAM, FAILED,
|
GST_ELEMENT_ERROR (flacdec, STREAM, FAILED,
|
||||||
(_("Internal data stream error.")),
|
(_("Internal data stream error.")),
|
||||||
("stream stopped, reason %s",
|
("stream stopped, reason %s",
|
||||||
gst_flow_get_name (flacdec->last_flow)));
|
gst_flow_get_name (flacdec->last_flow)));
|
||||||
goto eos_and_pause;
|
goto eos_and_pause;
|
||||||
|
} else if (flacdec->last_flow == GST_FLOW_UNEXPECTED) {
|
||||||
|
goto eos_and_pause;
|
||||||
} else if (flacdec->last_flow != GST_FLOW_OK) {
|
} else if (flacdec->last_flow != GST_FLOW_OK) {
|
||||||
goto pause;
|
goto pause;
|
||||||
}
|
}
|
||||||
|
@ -1161,7 +1163,7 @@ analyze_state:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (flacdec, "read aborted: last pull_range flow = %s",
|
GST_INFO_OBJECT (flacdec, "read aborted: last pull_range flow = %s",
|
||||||
gst_flow_get_name (flacdec->pull_flow));
|
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
|
/* it seems we need to flush the decoder here to reset the decoder
|
||||||
* state after the abort for FLAC__stream_decoder_seek_absolute()
|
* state after the abort for FLAC__stream_decoder_seek_absolute()
|
||||||
* to work properly */
|
* to work properly */
|
||||||
|
|
|
@ -1026,7 +1026,7 @@ out:
|
||||||
flacenc->offset += bytes;
|
flacenc->offset += bytes;
|
||||||
flacenc->samples_written += samples;
|
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_FATAL_ERROR;
|
||||||
|
|
||||||
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
|
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
|
||||||
|
|
Loading…
Reference in a new issue