I suppose it's wrong because it's only supposed to close the stream and not free AVFormatContext etc...I saw some of the other demuxers and they are freeing any pointers that they created in their local structures(in priv_data) but since I didn't do any, can I just return 0; ? ----------------- Sisir Koppaka