From 2ab382b196bc3336860db4523d25607d011c9ef5 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 18 Jan 2003 17:06:01 +0000 Subject: [PATCH] Interpollate timestamps Original commit message from CVS: Interpollate timestamps --- common | 2 +- ext/a52dec/gsta52dec.c | 12 ++++++++++++ ext/a52dec/gsta52dec.h | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/common b/common index 5b6a58f419..895baa0fa0 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 5b6a58f419c3d6fdd4abbe9943cd17a4fd2addcc +Subproject commit 895baa0fa0f829ef752424a31bbb2cf68e63842e diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c index 21df094377..427e1918d0 100644 --- a/ext/a52dec/gsta52dec.c +++ b/ext/a52dec/gsta52dec.c @@ -458,6 +458,12 @@ gst_a52dec_loop (GstElement *element) } data = GST_BUFFER_DATA (buf); timestamp = gst_bytestream_get_timestamp (a52dec->bs); + if (timestamp == a52dec->last_ts) { + timestamp = a52dec->current_ts; + } + else { + a52dec->last_ts = timestamp; + } /* process */ flags = a52dec->request_channels | A52_ADJUST_LEVEL; @@ -495,7 +501,11 @@ gst_a52dec_loop (GstElement *element) if (gst_a52dec_push (a52dec->srcpad, a52dec->using_channels, a52dec->samples, timestamp)) { g_warning ("a52dec push error\n"); } + else { + timestamp += sizeof (int16_t) * 256 * GST_SECOND / a52dec->sample_rate; + } } + a52dec->current_ts = timestamp; end: gst_buffer_unref (buf); @@ -521,6 +531,8 @@ gst_a52dec_change_state (GstElement * element) a52dec->using_channels = A52_CHANNEL; a52dec->level = 1; a52dec->bias = 384; + a52dec->last_ts = -1; + a52dec->current_ts = -1; break; case GST_STATE_PAUSED_TO_PLAYING: break; diff --git a/ext/a52dec/gsta52dec.h b/ext/a52dec/gsta52dec.h index b1162c6bc8..4cffd90808 100644 --- a/ext/a52dec/gsta52dec.h +++ b/ext/a52dec/gsta52dec.h @@ -61,6 +61,9 @@ struct _GstA52Dec { GstByteStream *bs; + GstClockTime last_ts; + GstClockTime current_ts; + GstCaps *streaminfo; };