mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
mpegtsmux: Set PTS on aligned buffers
This was broken in 09c05df
(make "alignment" property more useful for
packetisation).
https://bugzilla.gnome.org/show_bug.cgi?id=765926
This commit is contained in:
parent
a037f13271
commit
851c89ded9
1 changed files with 15 additions and 2 deletions
|
@ -1521,20 +1521,33 @@ mpegtsmux_push_packets (MpegTsMux * mux, gboolean force)
|
|||
|
||||
GST_LOG_OBJECT (mux, "aligning to %d bytes", align);
|
||||
while (align <= av) {
|
||||
gst_buffer_list_add (buffer_list,
|
||||
gst_adapter_take_buffer (mux->out_adapter, align));
|
||||
GstBuffer *buf;
|
||||
GstClockTime pts;
|
||||
|
||||
pts = gst_adapter_prev_pts (mux->out_adapter, NULL);
|
||||
buf = gst_adapter_take_buffer (mux->out_adapter, align);
|
||||
|
||||
GST_BUFFER_PTS (buf) = pts;
|
||||
|
||||
gst_buffer_list_add (buffer_list, buf);
|
||||
av -= align;
|
||||
}
|
||||
|
||||
if (av > 0 && force) {
|
||||
GstBuffer *buf;
|
||||
GstClockTime pts;
|
||||
guint8 *data;
|
||||
guint32 header;
|
||||
gint dummy;
|
||||
GstMapInfo map;
|
||||
|
||||
GST_LOG_OBJECT (mux, "handling %d leftover bytes", av);
|
||||
|
||||
pts = gst_adapter_prev_pts (mux->out_adapter, NULL);
|
||||
buf = gst_buffer_new_and_alloc (align);
|
||||
|
||||
GST_BUFFER_PTS (buf) = pts;
|
||||
|
||||
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||||
data = map.data;
|
||||
|
||||
|
|
Loading…
Reference in a new issue