From: Matej Knopp Date: Tue, 3 Sep 2013 15:32:41 +0000 (+0200) Subject: flacparse: cleanup on error after state change X-Git-Tag: 1.19.3~509^2~5361 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=349afc633a8d735eecf7e1b4744e6e82bf6f4a81;p=platform%2Fupstream%2Fgstreamer.git flacparse: cleanup on error after state change https://bugzilla.gnome.org/show_bug.cgi?id=707229 --- diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 8ac2804..a5b294a 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -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 */