mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
respect DEFAULT segment by clipping the last buffer to be sent
This commit is contained in:
parent
02f242a740
commit
a7902054bd
1 changed files with 11 additions and 0 deletions
|
@ -997,6 +997,17 @@ gst_flac_dec_write (GstFlacDec * flacdec, const FLAC__Frame * frame,
|
|||
guint j, i;
|
||||
GstClockTime next;
|
||||
|
||||
/* if a DEFAULT segment is configured, don't send samples past the end
|
||||
* of the segment */
|
||||
if (flacdec->segment.format == GST_FORMAT_DEFAULT &&
|
||||
flacdec->segment.stop != -1 &&
|
||||
flacdec->segment.last_stop > 0 &&
|
||||
flacdec->segment.last_stop + samples > flacdec->segment.stop) {
|
||||
samples = flacdec->segment.stop - flacdec->segment.last_stop;
|
||||
GST_DEBUG_OBJECT (flacdec,
|
||||
"clipping last buffer to %d samples because of segment", samples);
|
||||
}
|
||||
|
||||
switch (depth) {
|
||||
case 8:
|
||||
width = 8;
|
||||
|
|
Loading…
Reference in a new issue