From: <wt...@ke...> - 2006-04-18 11:02:21
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: wtay Date: Tue Apr 18 2006 11:02:16 UTC Log message: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_perform_seek), (gst_ffmpegdemux_loop): Don't try to convert -1 values when seeking. Adjust timestamps with start_time of the stream. Modified files: . : ChangeLog ext/ffmpeg : gstffmpegdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.287&r2=1.288 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c.diff?r1=1.59&r2=1.60 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.287 retrieving revision 1.288 diff -u -d -r1.287 -r1.288 --- ChangeLog 13 Apr 2006 16:22:53 -0000 1.287 +++ ChangeLog 18 Apr 2006 11:02:04 -0000 1.288 @@ -1,3 +1,10 @@ +2006-04-18 Wim Taymans <wi...@fl...> + + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_perform_seek), + (gst_ffmpegdemux_loop): + Don't try to convert -1 values when seeking. + Adjust timestamps with start_time of the stream. 2006-04-13 Wim Taymans <wi...@fl...> * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init), Index: gstffmpegdemux.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- gstffmpegdemux.c 13 Apr 2006 16:22:53 -0000 1.59 +++ gstffmpegdemux.c 18 Apr 2006 11:02:04 -0000 1.60 @@ -436,9 +436,9 @@ fmt = demux->segment.format; res = TRUE; /* FIXME, use source pad */ - if (cur_type != GST_SEEK_TYPE_NONE) + if (cur_type != GST_SEEK_TYPE_NONE && cur != -1) res = gst_pad_query_convert (demux->sinkpad, format, cur, &fmt, &cur); - if (res && stop_type != GST_SEEK_TYPE_NONE) + if (res && stop_type != GST_SEEK_TYPE_NONE && stop != -1) res = gst_pad_query_convert (demux->sinkpad, format, stop, &fmt, &stop); if (!res) goto no_format; @@ -1124,8 +1124,9 @@ /* do timestamps, we do this first so that we can know when we * stepped over the segment stop position. */ timestamp = gst_ffmpeg_time_ff_to_gst (pkt.pts, avstream->time_base); - if (GST_CLOCK_TIME_IS_VALID (timestamp)) + if (GST_CLOCK_TIME_IS_VALID (timestamp)) { stream->last_ts = timestamp; + } duration = gst_ffmpeg_time_ff_to_gst (pkt.duration, avstream->time_base); GST_DEBUG_OBJECT (demux, @@ -1134,11 +1135,16 @@ GST_TIME_ARGS (timestamp), pkt.size, pkt.stream_index, pkt.flags, GST_TIME_ARGS (duration), pkt.pos); + /* check start_time */ + if (demux->start_time != -1 && demux->start_time > timestamp) + goto drop; + timestamp -= demux->start_time; /* check if we ran outside of the segment */ if (demux->segment.stop != -1 && timestamp > demux->segment.stop) goto drop; - /* prepare to push packet to peer */ srcpad = stream->pad; |