flacparse: Don't drop the last frame if it is followed by garbage

See bug #631814.
This commit is contained in:
Sebastian Dröge 2010-10-12 10:27:53 +02:00
parent 6e1d65d788
commit f576c3f128

View file

@ -620,9 +620,9 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse, GstBuffer * buffer,
}
}
/* For the last frame check the CRC16 instead of the following
* header, which does not exist */
/* For the last frame output everything to the end */
if (G_UNLIKELY (gst_base_parse_get_drain (GST_BASE_PARSE (flacparse)))) {
if (flacparse->check_frame_checksums) {
guint16 actual_crc = gst_flac_calculate_crc16 (data, size - 2);
guint16 expected_crc = GST_READ_UINT16_BE (data + size - 2);
@ -631,6 +631,11 @@ gst_flac_parse_frame_is_valid (GstFlacParse * flacparse, GstBuffer * buffer,
flacparse->block_size = block_size;
return TRUE;
}
} else {
*ret = size;
flacparse->block_size = block_size;
return TRUE;
}
}
need_more: