diff --git a/ChangeLog b/ChangeLog index 2281c59506..cf3a215a1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-10-02 Ronald S. Bultje + + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): + Fix timestamps. Quite some of the gaming formats work now. :). + 2004-10-02 Ronald S. Bultje * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps), diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index 9833a76816..84dc6d233c 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -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) {