It's written in C++ and the MPEG PS/TS/ES demuxer can be found here, I think:
http://svn.berlios.de/wsvn/avidemux/...M_mpegdemuxer_
BTW: Avidemux creates index files to implement random access, similar (but most likely not identical) to DG(AVC)Index...