mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
vorbisdec: keep timestamps when no decoded output
Keep track of the timestamps even when we didn't generate decodable output.
This commit is contained in:
parent
eac243bc01
commit
1dafd7136d
1 changed files with 14 additions and 3 deletions
|
@ -840,8 +840,15 @@ vorbis_do_timestamps (GstVorbisDec * vd, GstBuffer * buf, gboolean reverse,
|
||||||
if (vd->last_timestamp != -1 && duration != -1 && !reverse)
|
if (vd->last_timestamp != -1 && duration != -1 && !reverse)
|
||||||
vd->last_timestamp += duration;
|
vd->last_timestamp += duration;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
GST_LOG_OBJECT (vd,
|
||||||
GST_BUFFER_DURATION (buf) = duration;
|
"keeping timestamp %" GST_TIME_FORMAT " ts %" GST_TIME_FORMAT " dur %"
|
||||||
|
GST_TIME_FORMAT, GST_TIME_ARGS (vd->last_timestamp),
|
||||||
|
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (duration));
|
||||||
|
|
||||||
|
if (buf) {
|
||||||
|
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
||||||
|
GST_BUFFER_DURATION (buf) = duration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
@ -850,7 +857,7 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet,
|
||||||
{
|
{
|
||||||
vorbis_sample_t **pcm;
|
vorbis_sample_t **pcm;
|
||||||
guint sample_count;
|
guint sample_count;
|
||||||
GstBuffer *out;
|
GstBuffer *out = NULL;
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
gint size;
|
gint size;
|
||||||
|
|
||||||
|
@ -910,6 +917,10 @@ vorbis_handle_data_packet (GstVorbisDec * vd, ogg_packet * packet,
|
||||||
result = vorbis_dec_push_reverse (vd, out);
|
result = vorbis_dec_push_reverse (vd, out);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (out == NULL) {
|
||||||
|
/* no output, still keep track of timestamps */
|
||||||
|
vorbis_do_timestamps (vd, NULL, FALSE, timestamp, duration);
|
||||||
|
}
|
||||||
vorbis_synthesis_read (&vd->vd, sample_count);
|
vorbis_synthesis_read (&vd->vd, sample_count);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue