mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 19:42:26 +00:00
flacdec: fix off by one between granpos and last_stop
This commit is contained in:
parent
14a9d1d66e
commit
5a73374f2c
1 changed files with 3 additions and 1 deletions
|
@ -978,7 +978,9 @@ gst_flac_dec_write (GstFlacDec * flacdec, const FLAC__Frame * frame,
|
|||
|
||||
if (flacdec->cur_granulepos != GST_BUFFER_OFFSET_NONE) {
|
||||
/* this should be fine since it should be one flac frame per ogg packet */
|
||||
flacdec->segment.last_stop = flacdec->cur_granulepos - samples;
|
||||
/* note the + 1, as the granpos is the presentation time of the last sample,
|
||||
whereas the last stop represents the end time of that sample */
|
||||
flacdec->segment.last_stop = flacdec->cur_granulepos - samples + 1;
|
||||
GST_LOG_OBJECT (flacdec, "granulepos = %" G_GINT64_FORMAT ", samples = %u",
|
||||
flacdec->cur_granulepos, samples);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue