Bug 1517199 Comment 33 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Hi, Andreas, 

Thank for the suggestion you gave me last time, and now I have some new questions. So for current WIP, I changed the way how `DecodedStream` deal with the audio data, now audio track would determine when it should end, instead of setting the end time via `EndTrackAt()` and comparing the time in `NotifyOutput()`. 

The reason of doing that is because, at the time calling `EndTrackAt()`  `DecodedStream` actually didn't know [the actual frames amount](https://searchfox.org/mozilla-central/rev/31a3457890b5698af1277413ee9d9bd6c5955183/dom/media/mediasink/DecodedStream.cpp#689) which would be writed. Because that would be determined later while appending data onto `mSegement` in `AudioDecoderInputTrack` (appending remaining +  resampling / time stretching) 

The problem I encounter now is that, I don't know how to suspend the track when `DecodedStream` is not playing (i.e. media is paused). So even if the `DecodedStream` is not playing, `AudioDecoderInputTrack` would keep appending silience to the `MTG`, which causes `DecodedStream::NotifyOutput()` being called during media is paused.

I saw that `MediaTrack::Suspend()` seems something I can try, but I'm not sure if that is a right way to do, because `MTG` might have its own way to manage the tracks.

Thank you so much.
Hi, Andreas, 

Thank for the suggestion you gave me last time, and now I have some new questions. So for current WIP, I changed the way how `DecodedStream` deal with the audio data, now audio track would determine when it should end, instead of setting the end time via `EndTrackAt()` and comparing the time in `NotifyOutput()`. 

The reason of doing that is because, at the time calling `EndTrackAt()`  `DecodedStream` actually didn't know [the actual frames amount](https://searchfox.org/mozilla-central/rev/31a3457890b5698af1277413ee9d9bd6c5955183/dom/media/mediasink/DecodedStream.cpp#689) which would be writed. That would be determined later while appending data onto `mSegement` in `AudioDecoderInputTrack` (appending remaining +  resampling / time stretching) 

The problem I encounter now is that, I don't know how to suspend the track when `DecodedStream` is not playing (i.e. media is paused). So even if the `DecodedStream` is not playing, `AudioDecoderInputTrack` would keep appending silience to the `MTG`, which causes `DecodedStream::NotifyOutput()` being called during media is paused.

I saw that `MediaTrack::Suspend()` seems something I can try, but I'm not sure if that is a right way to do, because `MTG` might have its own way to manage the tracks.

Thank you so much.

Back to Bug 1517199 Comment 33