gstavdemux: adjust seeking offset according to start_time

https://bugzilla.gnome.org/show_bug.cgi?id=733094
This commit is contained in:
Matej Knopp 2014-07-12 15:26:36 +02:00 committed by Edward Hervey
parent 720fc4ffef
commit c182d28770

View file

@ -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;