mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
gstavdemux: adjust seeking offset according to start_time
https://bugzilla.gnome.org/show_bug.cgi?id=733094
This commit is contained in:
parent
720fc4ffef
commit
c182d28770
1 changed files with 6 additions and 1 deletions
|
@ -460,7 +460,7 @@ gst_ffmpegdemux_do_seek (GstFFMpegDemux * demux, GstSegment * segment)
|
||||||
/* get the stream for seeking */
|
/* get the stream for seeking */
|
||||||
stream = demux->context->streams[index];
|
stream = demux->context->streams[index];
|
||||||
/* initial seek position */
|
/* initial seek position */
|
||||||
target = segment->position;
|
target = segment->position + demux->start_time;
|
||||||
/* convert target to ffmpeg time */
|
/* convert target to ffmpeg time */
|
||||||
fftarget = gst_ffmpeg_time_gst_to_ff (target, stream->time_base);
|
fftarget = gst_ffmpeg_time_gst_to_ff (target, stream->time_base);
|
||||||
|
|
||||||
|
@ -503,6 +503,11 @@ gst_ffmpegdemux_do_seek (GstFFMpegDemux * demux, GstSegment * segment)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "seek success, returned %d", seekret);
|
GST_DEBUG_OBJECT (demux, "seek success, returned %d", seekret);
|
||||||
|
|
||||||
|
if (target > demux->start_time)
|
||||||
|
target -= demux->start_time;
|
||||||
|
else
|
||||||
|
target = 0;
|
||||||
|
|
||||||
segment->position = target;
|
segment->position = target;
|
||||||
segment->time = target;
|
segment->time = target;
|
||||||
segment->start = target;
|
segment->start = target;
|
||||||
|
|
Loading…
Reference in a new issue