diff options
author | Robert Swain <robert.swain@collabora.co.uk> | 2010-02-16 12:59:54 +0100 |
---|---|---|
committer | Robert Swain <robert.swain@collabora.co.uk> | 2010-02-16 13:02:47 +0100 |
commit | ad45fd18270ef42baf6f46235c5b5600dc6b6171 (patch) | |
tree | 6bdb5da15e265f674c813b7711e543b2159aedaf | |
parent | bde03ffc019ef64d74e997e06199d5cad136dc15 (diff) |
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.
-rw-r--r-- | gst/asfdemux/gstasfdemux.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 72a7e523..f5eccee8 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -661,9 +661,12 @@ gst_asf_demux_handle_seek_event (GstASFDemux * demux, GstEvent * event) GST_TIME_ARGS (seek_time), offset, demux->data_offset, demux->packet_size, packet); } else { - /* Hackety hack, this sucks. We just seek to an earlier position - * and let the sinks throw away the stuff before the segment start */ - if (flush && (demux->accurate || keyunit_sync)) { + /* FIXME: For streams containing video, seek to an earlier position in + * the hope of hitting a keyframe and let the sinks throw away the stuff + * 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; if (seek_time < 0) seek_time = 0; |