Page 1 of 1

Infinite loop when stopping a fMP4 streaming on a slow network

Posted: 09 Jan 2018 01:25
by Jimmychaohc
Reproduction Steps:
1. Start a fMP4 stream
2. Throttle network so the player goes into a frequent buffering state
3. Stop player

Expected Result:
Player stops

Actual Result:
Player hangs, CPU goes to 100% and I need to force terminate the application.

I've tested this on VLC for MacOS and iOS.

It seems like the issue is with FragDemuxTrack() method in /modules/demux/mp4/mp4.c
I don't know enough about VLC to determine exactly what is the problem, but from what I can tell, under normal circumstances the code goes through the entire method no problem and exits at the end with "return VLC_DEMUXER_SUCCESS;".

But when there is latency and stop is pressed on the player, the code goes into the conditional statement "if( i_read < len || p_block == NULL )" of the function "FragDemuxTrack()" and breaks out with "return VLC_DEMUXER_EOF;"

This returns to the calling method DemuxMoof() which is currently in an infinite for loop for( ;; ) until it breaks. Since FragDemuxTrack() returned early without incrementing the "p_track->context.runs.i_current" the loop never ends.

Do we know if there exist a ticket on this somewhere or should I create a bug? Thanks!

Re: Infinite loop when stopping a fMP4 streaming on a slow network

Posted: 09 Jan 2018 09:42
by InTheWings
should be fixed from tomorrow's build