mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
Interpollate timestamps
Original commit message from CVS: Interpollate timestamps
This commit is contained in:
parent
96e4e1cbeb
commit
2ab382b196
3 changed files with 16 additions and 1 deletions
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 5b6a58f419c3d6fdd4abbe9943cd17a4fd2addcc
|
||||
Subproject commit 895baa0fa0f829ef752424a31bbb2cf68e63842e
|
|
@ -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;
|
||||
|
|
|
@ -61,6 +61,9 @@ struct _GstA52Dec {
|
|||
|
||||
GstByteStream *bs;
|
||||
|
||||
GstClockTime last_ts;
|
||||
GstClockTime current_ts;
|
||||
|
||||
GstCaps *streaminfo;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue