Commit c1daa360 authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/gstffmpegdemux.c: Fix timestamps. Quite some of the gaming formats work now. :).

Original commit message from CVS:
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
Fix timestamps. Quite some of the gaming formats work now. :).
parent 3cf593d8
2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
Fix timestamps. Quite some of the gaming formats work now. :).
2004-10-02 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
......
......@@ -617,15 +617,16 @@ gst_ffmpegdemux_loop (GstElement * element)
/* and handle the data by pushing it forward... */
if (pad && GST_PAD_IS_USABLE (pad)) {
AVStream *stream = gst_ffmpegdemux_stream_from_pad (pad);
GstBuffer *outbuf;
outbuf = gst_buffer_new_and_alloc (pkt.size);
memcpy (GST_BUFFER_DATA (outbuf), pkt.data, pkt.size);
GST_BUFFER_SIZE (outbuf) = pkt.size;
if (pkt.pts != AV_NOPTS_VALUE && demux->context->pts_den) {
GST_BUFFER_TIMESTAMP (outbuf) = (double) pkt.pts * GST_SECOND *
demux->context->pts_num / demux->context->pts_den;
if (pkt.pts != AV_NOPTS_VALUE) {
GST_BUFFER_TIMESTAMP (outbuf) = (gdouble) (pkt.pts +
stream->start_time) * GST_SECOND / AV_TIME_BASE;
}
if (pkt.flags & PKT_FLAG_KEY) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment