mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
ext/ffmpeg/gstffmpegdemux.c: Don't try to convert -1 values when seeking.
Original commit message from CVS: * 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.
This commit is contained in:
parent
55eac5b0c0
commit
33255a18c4
2 changed files with 17 additions and 4 deletions
|
@ -1,3 +1,10 @@
|
|||
2006-04-18 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* 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 <wim@fluendo.com>
|
||||
|
||||
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_base_init),
|
||||
|
|
|
@ -436,9 +436,9 @@ gst_ffmpegdemux_perform_seek (GstFFMpegDemux * demux, GstEvent *event)
|
|||
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 @@ gst_ffmpegdemux_loop (GstPad * pad)
|
|||
/* 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_ffmpegdemux_loop (GstPad * pad)
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue