pts encoding fix patch by (Thomas Jarosch <tomj at simonv dot com>)