ogg: Fix generation of timestamps and durations

After changing some internal functions, I forgot to update
the code that puts the values on the buffers.
This commit is contained in:
David Schleef 2009-11-21 22:05:34 +01:00
parent 72edd1467b
commit ab0d802781

View file

@ -460,6 +460,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
GstOggDemux *ogg = pad->ogg; GstOggDemux *ogg = pad->ogg;
gint64 current_time; gint64 current_time;
GstOggChain *chain; GstOggChain *chain;
gint64 duration;
GST_DEBUG_OBJECT (ogg, GST_DEBUG_OBJECT (ogg,
"%p streaming to peer serial %08x", pad, pad->map.serialno); "%p streaming to peer serial %08x", pad, pad->map.serialno);
@ -476,10 +477,14 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
/* copy packet in buffer */ /* copy packet in buffer */
memcpy (buf->data, packet->packet, packet->bytes); memcpy (buf->data, packet->packet, packet->bytes);
GST_BUFFER_TIMESTAMP (buf) = gst_ogg_stream_get_packet_start_time (&pad->map, duration = gst_ogg_stream_get_packet_duration (&pad->map, packet);
packet);
GST_BUFFER_DURATION (buf) = gst_ogg_stream_get_packet_duration (&pad->map, GST_BUFFER_TIMESTAMP (buf) = gst_ogg_stream_granule_to_time (&pad->map,
packet); pad->current_granule);
pad->current_granule += duration;
GST_BUFFER_DURATION (buf) = gst_ogg_stream_granule_to_time (&pad->map,
pad->current_granule) - GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_OFFSET (buf) = -1; GST_BUFFER_OFFSET (buf) = -1;
GST_BUFFER_OFFSET_END (buf) = packet->granulepos; GST_BUFFER_OFFSET_END (buf) = packet->granulepos;