flacparse: rework gst_flac_parse_frame_is_valid()

drop unnecessary nesting looking for end of frame
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2015-12-30 01:56:26 -08:00
parent 90b62be301
commit 276fcc5916

View file

@ -676,7 +676,10 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse,
remaining = map.size;
for (i = search_start; i < search_end; i++, remaining--) {
if ((GST_READ_UINT16_BE (map.data + i) & 0xfffe) == 0xfff8) {
if ((GST_READ_UINT16_BE (map.data + i) & 0xfffe) != 0xfff8)
continue;
GST_LOG_OBJECT (flacparse, "possible frame end at offset %d", i);
suspect_end = FALSE;
header_ret =
@ -703,7 +706,6 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse,
goto need_more;
}
}
}
/* For the last frame output everything to the end */
if (G_UNLIKELY (GST_BASE_PARSE_DRAINING (flacparse))) {