mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
asfdemux: Improve seek behaviour for audio-only with no index
Instead of seeking to seek_time - 5s in the hope of hitting a keyframe for video, we can just seek to seek_time instead.
This commit is contained in:
parent
bde03ffc01
commit
ad45fd1827
1 changed files with 6 additions and 3 deletions
|
@ -661,9 +661,12 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event)
|
||||||
GST_TIME_ARGS (seek_time), offset, demux->data_offset,
|
GST_TIME_ARGS (seek_time), offset, demux->data_offset,
|
||||||
demux->packet_size, packet);
|
demux->packet_size, packet);
|
||||||
} else {
|
} else {
|
||||||
/* Hackety hack, this sucks. We just seek to an earlier position
|
/* FIXME: For streams containing video, seek to an earlier position in
|
||||||
* and let the sinks throw away the stuff before the segment start */
|
* the hope of hitting a keyframe and let the sinks throw away the stuff
|
||||||
if (flush && (demux->accurate || keyunit_sync)) {
|
* before the segment start. For audio-only this is unnecessary as every
|
||||||
|
* frame is 'key'. */
|
||||||
|
if (flush && (demux->accurate || keyunit_sync)
|
||||||
|
&& demux->num_video_streams > 0) {
|
||||||
seek_time -= 5 * GST_SECOND;
|
seek_time -= 5 * GST_SECOND;
|
||||||
if (seek_time < 0)
|
if (seek_time < 0)
|
||||||
seek_time = 0;
|
seek_time = 0;
|
||||||
|
|
Loading…
Reference in a new issue