mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
3cf593d824
commit
c1daa360bb
2 changed files with 9 additions and 3 deletions
|
@ -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),
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue