gst_adapter_prev_timestamp -> gst_adapter_prev_pts

This commit is contained in:
Tim-Philipp Müller 2012-11-14 12:41:27 +00:00
parent 3abce95e61
commit 9f7e7d305d
2 changed files with 9 additions and 7 deletions

View file

@ -909,7 +909,7 @@ gst_audio_visualizer_chain (GstPad * pad, GstObject * parent,
GstVideoFrame outframe; GstVideoFrame outframe;
/* get timestamp of the current adapter content */ /* get timestamp of the current adapter content */
ts = gst_adapter_prev_timestamp (scope->adapter, &dist); ts = gst_adapter_prev_pts (scope->adapter, &dist);
if (GST_CLOCK_TIME_IS_VALID (ts)) { if (GST_CLOCK_TIME_IS_VALID (ts)) {
/* convert bytes to time */ /* convert bytes to time */
dist /= bps; dist /= bps;

View file

@ -1329,13 +1329,14 @@ mpegtsmux_push_packets (MpegTsMux * mux, gboolean force)
else else
align *= packet_size; align *= packet_size;
/* FIXME: what about DTS here? */
GST_LOG_OBJECT (mux, "aligning to %d bytes", align); GST_LOG_OBJECT (mux, "aligning to %d bytes", align);
if (G_LIKELY ((align <= av) && av)) { if (G_LIKELY ((align <= av) && av)) {
GST_LOG_OBJECT (mux, "pushing %d aligned bytes", av - (av % align)); GST_LOG_OBJECT (mux, "pushing %d aligned bytes", av - (av % align));
ts = gst_adapter_prev_timestamp (mux->out_adapter, NULL); ts = gst_adapter_prev_pts (mux->out_adapter, NULL);
buf = gst_adapter_take_buffer (mux->out_adapter, av - (av % align)); buf = gst_adapter_take_buffer (mux->out_adapter, av - (av % align));
g_assert (buf); g_assert (buf);
GST_BUFFER_TIMESTAMP (buf) = ts; GST_BUFFER_PTS (buf) = ts;
ret = gst_pad_push (mux->srcpad, buf); ret = gst_pad_push (mux->srcpad, buf);
av = av % align; av = av % align;
@ -1351,11 +1352,11 @@ mpegtsmux_push_packets (MpegTsMux * mux, gboolean force)
buf = gst_buffer_new_and_alloc (align); buf = gst_buffer_new_and_alloc (align);
gst_buffer_map (buf, &map, GST_MAP_READ); gst_buffer_map (buf, &map, GST_MAP_READ);
data = map.data; data = map.data;
ts = gst_adapter_prev_timestamp (mux->out_adapter, NULL); ts = gst_adapter_prev_pts (mux->out_adapter, NULL);
gst_adapter_copy (mux->out_adapter, data, 0, av); gst_adapter_copy (mux->out_adapter, data, 0, av);
gst_adapter_clear (mux->out_adapter); gst_adapter_clear (mux->out_adapter);
GST_BUFFER_TIMESTAMP (buf) = ts; GST_BUFFER_PTS (buf) = ts;
data += av; data += av;
header = GST_READ_UINT32_BE (data - packet_size); header = GST_READ_UINT32_BE (data - packet_size);
@ -1469,12 +1470,13 @@ new_packet_m2ts (MpegTsMux * mux, GstBuffer * buf, gint64 new_pcr)
gst_util_uint64_scale (mux->previous_offset - offset, gst_util_uint64_scale (mux->previous_offset - offset,
mux->pcr_rate_num, mux->pcr_rate_den); mux->pcr_rate_num, mux->pcr_rate_den);
ts = gst_adapter_prev_timestamp (mux->adapter, NULL); /* FIXME: what about DTS here? */
ts = gst_adapter_prev_pts (mux->adapter, NULL);
out_buf = gst_adapter_take_buffer (mux->adapter, M2TS_PACKET_LENGTH); out_buf = gst_adapter_take_buffer (mux->adapter, M2TS_PACKET_LENGTH);
g_assert (out_buf); g_assert (out_buf);
offset += M2TS_PACKET_LENGTH; offset += M2TS_PACKET_LENGTH;
GST_BUFFER_TIMESTAMP (out_buf) = ts; GST_BUFFER_PTS (out_buf) = ts;
gst_buffer_map (out_buf, &map, GST_MAP_WRITE); gst_buffer_map (out_buf, &map, GST_MAP_WRITE);