Closed Bug 1508501 Opened 6 years ago Closed 6 years ago

After seeking to start position, demuxer can't get the first sample

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1505250

People

(Reporter: alwu, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Assignee: nobody → alwu
Priority: -- → P3
Hi, Jya, I found that FLAC demuxer would incorrectly return EOS when resource is fetching data too slowly [1]. In the log, you can see the previous sample it returned is [185759,197368] > MediaDecoderStateMachine[0xdf4e1800] Decoder=e7f91190 OnAudioDecoded [185759,197368] However, for `flac-s24.flac`, that sample is apparently not the last frame. The last frame should be [3993832,4040271]. In addition, this sample is also weird, because when I used `ffprobe` to check the sample inside [2], the sample should be look like [185759,278638]. I don't know why the sample we demuxed was so short. I looked our code and saw that we would return EOS if we can't read enough size from resource [3]. If resource is still fetching data, that would cause unexpected EOS. Do you have any idea about that? Thank you. [1] https://pastebin.com/raw/b2Ak7b9A [2] { "codec_type": "audio", "stream_index": 0, "pts": 16384, "pts_time": "0.185760", "dts": 16384, "dts_time": "0.185760", "duration": 8192, "duration_time": "0.092880", "size": "21324", "pos": "51330", "flags": "K_" } [3] https://searchfox.org/mozilla-central/rev/55895c49f55073d82d977cb74ec1d3a71ae4b25f/dom/media/flac/FlacDemuxer.cpp#273
Flags: needinfo?(jyavenard)
(In reply to Alastor Wu [:alwu] from comment #1) > Hi, Jya, > > I found that FLAC demuxer would incorrectly return EOS when resource is > fetching data too slowly [1]. > > In the log, you can see the previous sample it returned is [185759,197368] > > MediaDecoderStateMachine[0xdf4e1800] Decoder=e7f91190 OnAudioDecoded [185759,197368] > > However, for `flac-s24.flac`, that sample is apparently not the last frame. > The last frame should be [3993832,4040271]. In addition, this sample is also > weird, because when I used `ffprobe` to check the sample inside [2], the > sample should be look like [185759,278638]. I don't know why the sample we > demuxed was so short. > > I looked our code and saw that we would return EOS if we can't read enough > size from resource [3]. If resource is still fetching data, that would cause > unexpected EOS. the scenario you describe can't occur. Reading the MediaResource is blocking. The only time the MediaResource will return less data than requested is when the MediaResource have reached EOS and there's no more data to fetch. So you can't have an unexpected EOS because it's too slow or we're still fetching data. If you get EOS, there's nothing more to read and there's no point trying again.
Flags: needinfo?(jyavenard)
See Also: → 1505250
Will fix this issue in bug 1505250.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
See Also: 1505250
You need to log in before you can comment on or make changes to this bug.