A method for correcting errors in a digital media transport stream, wherein the digital media transport stream comprises a stream of digital data packets, wherein each digital data packet of the stream of digital data packets comprises at least one header data field and information blocks in payload data uniquely identifying a packet type of the corresponding digital data packet, wherein the packet type is one of a plurality of packet types pre-defined for the digital media transport stream, wherein the plurality of pre-defined packet types comprises a video data packet, an audio data packet, a program association table packet, a program map table packet, a scene description packet, an object description packet and a Null packet, the method comprising: - retrieving a plurality of header masks from error-free packets of the underlying media transport stream or from a storage device, wherein each header mask is associated with a corresponding packet type of the plurality of packet types and wherein each header mask identifies those header data fields which uniquely identify the associated packet type and provides an expected value or value range for each of those header data fields, - receiving a digital data packet of the digital media transport stream, - for each header mask of the plurality of header masks: comparing the header data fields of the received digital data packet with the header data fields of the header mask, and determining a Hamming distance between the header data fields of the received digital data packet and the header data fields of the header mask, - in case the determined Hamming distance between the header data fields of the received digital data packet and the header data fields of one of the header masks is zero: determining the packet type of the one header mask as the packet type of the received digital data packet, - in case the determined Hamming distance between the header data fields of the received digital data packet and the header data fields of none of the header masks is zero: - determining a predefined number of the packet types associated with those header masks having the smallest Hamming distances with respect to the received digital data packet, - determining for each determined packet type a confidence factor based on a comparison of additional data of the received digital data packet and expected additional data predefined for the corresponding packet type, wherein the additional data comprises predefined parts of the payload data subsequent to the header data fields, wherein the expected additional data is predefined specifically for each packet type, and - determining the packet type with the highest confidence factor as the packet type of the received digital data packet, and - correcting the received digital data packet based on the determined packet type. - retrieving a plurality of header masks from error-free packets of the underlying media transport stream or from a storage device, wherein each header mask is associated with a corresponding packet type of the plurality of packet types and wherein each header mask identifies those header data fields which uniquely identify the associated packet type and provides an expected value or value range for each of those header data fields, - receiving a digital data packet of the digital media transport stream, - for each header mask of the plurality of header masks: comparing the header data fields of the received digital data packet with the header data fields of the header mask, and determining a Hamming distance between the header data fields of the received digital data packet and the header data fields of the header mask, - in case the determined Hamming distance between the header data fields of the received digital data packet and the header data fields of one of the header masks is zero: determining the packet type of the one header mask as the packet type of the received digital data packet, - in case the determined Hamming distance between the header data fields of the received digital data packet and the header data fields of none of the header masks is zero: - determining a predefined number of the packet types associated with those header masks having the smallest Hamming distances with respect to the received digital data packet, - determining for each determined packet type a confidence factor based on a comparison of additional data of the received digital data packet and expected additional data predefined for the corresponding packet type, wherein the additional data comprises predefined parts of the payload data subsequent to the header data fields, wherein the expected additional data is predefined specifically for each packet type, and - determining the packet type with the highest confidence factor as the packet type of the received digital data packet, and - determining a predefined number of the packet types associated with those header masks having the smallest Hamming distances with respect to the received digital data packet, - determining for each determined packet type a confidence factor based on a comparison of additional data of the received digital data packet and expected additional data predefined for the corresponding packet type, wherein the additional data comprises predefined parts of the payload data subsequent to the header data fields, wherein the expected additional data is predefined specifically for each packet type, and - determining the packet type with the highest confidence factor as the packet type of the received digital data packet, and - correcting the received digital data packet based on the determined packet type.