This proposed fix moves pcSlice->setNalUnitType() before picHeader->setGdrOrIrapPicFlag() so that the value of gdr_or_irap_pic_flag is set correctly, as reported in ticket #941.