demux: mp4: rewrite and strengthen the restart stuff
demux: mp4: rewrite and strengthen the restart stuff

Also adds the missing restart on MP4Leaf demux mode

vlc-mirror/vlc,shyamalschandra/vlc,krichter722/vlc,shyamalschandra/vlc,krichter722/vlc,krichter722/vlc,xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,xkfz007/vlc,vlc-mirror/vlc,krichter722/vlc,xkfz007/vlc,vlc-mirror/vlc,vlc-mirror/vlc,krichter722/vlc,vlc-mirror/vlc,krichter722/vlc,vlc-mirror/vlc,vlc-mirror/vlc,xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,krichter722/vlc