mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 22:05:58 +00:00
flacdec: really use upstream timestamp if there is one
See/fixes #603471.
This commit is contained in:
parent
4c1947045e
commit
a76af918d0
1 changed files with 14 additions and 2 deletions
|
@ -39,6 +39,7 @@
|
|||
*/
|
||||
|
||||
/* TODO: add seeking when operating chain-based with unframed input */
|
||||
/* FIXME: demote/remove granulepos handling and make more time-centric */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
|
@ -1301,8 +1302,19 @@ gst_flac_dec_chain (GstPad * pad, GstBuffer * buf)
|
|||
GST_BUFFER_SIZE (buf), &unused);
|
||||
|
||||
/* oggdemux will set granulepos in OFFSET_END instead of timestamp */
|
||||
if (got_audio_frame && !GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||
dec->cur_granulepos = GST_BUFFER_OFFSET_END (buf);
|
||||
if (G_LIKELY (got_audio_frame)) {
|
||||
/* old oggdemux for now */
|
||||
if (!GST_BUFFER_TIMESTAMP_IS_VALID (buf)) {
|
||||
dec->cur_granulepos = GST_BUFFER_OFFSET_END (buf);
|
||||
} else {
|
||||
GstFormat dformat = GST_FORMAT_DEFAULT;
|
||||
|
||||
/* upstream (e.g. demuxer) presents us time,
|
||||
* convert to default samples */
|
||||
gst_flac_dec_convert_src (dec->srcpad, GST_FORMAT_TIME,
|
||||
GST_BUFFER_TIMESTAMP (buf), &dformat, &dec->segment.last_stop);
|
||||
dec->cur_granulepos = GST_BUFFER_OFFSET_NONE;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dec->cur_granulepos = GST_BUFFER_OFFSET_NONE;
|
||||
|
|
Loading…
Reference in a new issue