GNOME Bugzilla – Bug 708598
asfdemux: when seek to end of file, some asf recieve EOS and then finished. But some asf file play from beginning.
Last modified: 2013-09-25 22:17:45 UTC
When play asf video, using gst_element_seek_simple interface, seek to 62000ms while the duration of video is 62455ms. Expect result is application can recieve EOS immediately, but the actual result is video play again from beginning. After debug, i found in asfdemux when process simple index object, the last index entry will be lost. For example, my video should have 66 index entry, but in gstasfdemux.c:3332 Line when process the last index entry, the condition G_UNLIKELY (size <= 6) return true, so the last index entry will not add to index table. So there are 65 elements in index table, when i seek to 62000ms, the match idx is 65(the last index entry) but packet value is 0. So the video play again from beginning.
Can you share your video sample somewhere or is this reproducible with other samples, too?
I think for any asf file, the last index entry couldn't add to array. Please check.
This sounds like two bugs then: a) handling of last index entry b) it should not start at the beginning, but just continue where it was
commit 556055e2f1e2238c0d9cb67b0922635b69917f97 Author: Thiago Santos <ts.santos@partner.samsung.com> Date: Tue Sep 24 10:08:10 2013 -0700 asfdemux: Only use segment.start as seek_time if it is relative Relying on the gst_segment_do_seek results for getting the seeking time should not be used if seek type is SET because the do_seek function makes the 'cur` position of the seek normalized on the segment range. This means that seeking beyond the end of the file might not result in instant EOS as it will end up seeking to the final ts of the file. In asf seeking to the final timestamp can lead to seeking to the last keyframe, meaning a few seconds of video will still be played, which should not be the desired behavior when seeking beyong file limits. commit abe5ca6d962fdd34c1292b71f72495475eac2174 Author: Thiago Santos <ts.santos@partner.samsung.com> Date: Tue Sep 24 10:07:25 2013 -0700 asfdemux: Parse last simple index entry The entry size is fixed at 6, fix typo to finish parsing the index correctly until the last sample