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. :).
This commit is contained in:
Ronald S. Bultje 2004-10-02 21:17:26 +00:00
parent 3cf593d824
commit c1daa360bb
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
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),

View file

@ -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) {