diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index d160a52c97..42b13c639d 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -1676,7 +1676,7 @@ gst_flac_dec_convert_src (GstPad * pad, GstFormat src_format, gint64 src_value, case GST_FORMAT_BYTES: scale = bytes_per_sample; case GST_FORMAT_DEFAULT: - *dest_value = gst_util_uint64_scale_int (src_value, + *dest_value = gst_util_uint64_scale_int_round (src_value, scale * flacdec->sample_rate, GST_SECOND); break; default: diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index 00999a0782..070e94997d 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -331,8 +331,12 @@ gst_aac_parse_check_adts_frame (GstAacParse * aacparse, if ((data[0] == 0xff) && ((data[1] & 0xf6) == 0xf0)) { *framesize = gst_aac_parse_adts_get_frame_len (data); - /* In EOS mode this is enough. No need to examine the data further */ - if (drain) { + /* In EOS mode this is enough. No need to examine the data further. + We also relax the check when we have sync, on the assumption that + if we're not looking at random data, we have a much higher chance + to get the correct sync, and this avoids losing two frames when + a single bit corruption happens. */ + if (drain || !GST_BASE_PARSE_LOST_SYNC (aacparse)) { return TRUE; }