locked
About timestamp Gap in stream RRS feed

  • Question

  • There is a large time stamp gap in a media file, how can i support it in my media source?

    now it doesn't move when play to the gap, but the media source is still deliver samples.


    haha

    Wednesday, September 19, 2012 9:13 AM

Answers

  • There are two means to deal with timestamp gaps.  The first is the one you are using, MFSampleExtension_Discontinuity, which signals a timestamp jump.  The other is using the MEStreamTick event, which signals data missing at a given time in the stream.

    Note that neither of these will cause the presentation clock to jump; instead, for example, the audio renderer will render silence.  This is because the session cannot know for sure that a timestamp discontinuity on a stream means that the clock should jump.  In such a scenario, there might be other streams that have data for that period, so jumping the clock would result in dropping data from those streams.

    If you want to just jump through a timestamp discontinuity, the source should adjust timestamps so that they are continuous.

    • Marked as answer by wuyueduzun Tuesday, December 11, 2012 1:52 AM
    Wednesday, October 24, 2012 6:37 PM

All replies

  • i Find a cue, set MFSampleExtension_Discontinuity for the first sample after the gap, but it seems not work

    haha

    Thursday, September 20, 2012 9:49 AM
  • There are two means to deal with timestamp gaps.  The first is the one you are using, MFSampleExtension_Discontinuity, which signals a timestamp jump.  The other is using the MEStreamTick event, which signals data missing at a given time in the stream.

    Note that neither of these will cause the presentation clock to jump; instead, for example, the audio renderer will render silence.  This is because the session cannot know for sure that a timestamp discontinuity on a stream means that the clock should jump.  In such a scenario, there might be other streams that have data for that period, so jumping the clock would result in dropping data from those streams.

    If you want to just jump through a timestamp discontinuity, the source should adjust timestamps so that they are continuous.

    • Marked as answer by wuyueduzun Tuesday, December 11, 2012 1:52 AM
    Wednesday, October 24, 2012 6:37 PM
  • Note that neither of these will cause the presentation clock to jump; ...

    One thing you could try is issuing MEStreamTick events from your decoders to fill the gaps. This explicitly tells the SAR (and any other interested downstream components) that there is a gap in the audio, and the SAR will insert silence, which is what you want.

    Also note that you shouldn't set the Discontinuity flag after the gap. That flag causes the SAR to jump the clock time immediately. "Discontinuity" means that these timestamps are discontinuous with the previous timestamps, and therefore the space between them shouldn't be honored. Without this flag, the SAR will wait until the clock ticks up to the timestamp before playing the samples, which I believe is what you want.

    <input id="bdd47395-ee45-412a-a73f-b5b70f7c2c5c_attachments" type="hidden" value="" />
    Becky Weiss - MSFT  Wednesday, May 28, 2008 11:52 PM


    So what is the purpose of this attribute?  It doesn't do anything but fool those who use it.  I think it is better to simply not use it if "you do not want the PC to jump" and if you use it, then by inference, "you want the PC to jump".  Dead and done, I know.  But going by the quoted stuff above, it wasn't supposed to be like this.

    Thursday, March 28, 2013 12:24 PM