After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708598 - asfdemux: when seek to end of file, some asf recieve EOS and then finished. But some asf file play from beginning.
asfdemux: when seek to end of file, some asf recieve EOS and then finished. B...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
1.0.5
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-09-23 05:31 UTC by Haijiao Qiao
Modified: 2013-09-25 22:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Haijiao Qiao 2013-09-23 05:31:09 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.
Comment 1 Thiago Sousa Santos 2013-09-24 00:52:04 UTC
Can you share your video sample somewhere or is this reproducible with other samples, too?
Comment 2 Haijiao Qiao 2013-09-24 01:39:38 UTC
I think for any asf file, the last index entry couldn't add to array. Please check.
Comment 3 Tim-Philipp Müller 2013-09-24 07:51:52 UTC
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
Comment 4 Thiago Sousa Santos 2013-09-24 21:45:33 UTC
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