flacparse: cleanup on error after state change

https://bugzilla.gnome.org/show_bug.cgi?id=707229
This commit is contained in:
Matej Knopp 2013-09-03 17:32:41 +02:00 committed by Sebastian Dröge
parent 7f59436979
commit 349afc633a

View file

@ -1576,13 +1576,15 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
}
if (is_last) {
if ((res = gst_flac_parse_handle_headers (flacparse)) != GST_FLOW_OK)
goto cleanup;
res = gst_flac_parse_handle_headers (flacparse);
/* Minimal size of a frame header */
gst_base_parse_set_min_frame_size (GST_BASE_PARSE (flacparse), MAX (9,
flacparse->min_framesize));
flacparse->state = GST_FLAC_PARSE_STATE_DATA;
if (res != GST_FLOW_OK)
goto cleanup;
}
/* DROPPED because we pushed already or will push all headers manually */
@ -1615,18 +1617,18 @@ gst_flac_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame,
GST_WARNING_OBJECT (flacparse,
"Generating headers for variable blocksize streams not supported");
if ((res = gst_flac_parse_handle_headers (flacparse)) != GST_FLOW_OK)
goto cleanup;
res = gst_flac_parse_handle_headers (flacparse);
} else {
GST_DEBUG_OBJECT (flacparse, "Generating headers");
if (!gst_flac_parse_generate_headers (flacparse))
goto cleanup;
if ((res = gst_flac_parse_handle_headers (flacparse)) != GST_FLOW_OK)
goto cleanup;
res = gst_flac_parse_handle_headers (flacparse);
}
flacparse->state = GST_FLAC_PARSE_STATE_DATA;
if (res != GST_FLOW_OK)
goto cleanup;
}
/* also cater for oggmux metadata */