import struct


def mrt_block_unpack( packed_bytes ):
    """Decodes an MRT header block."""
    (time_secs, mrt_type, mrt_subtype, content_length) = struct.unpack( '!LHHL', packed_bytes[0:12])
    content_pad = packed_bytes[12:]
    content = content_pad[:content_length]
    parsed = { 'time_secs'      : time_secs,
                'mrt_type'      : mrt_type,
                'mrt_subtype'   : mrt_subtype,
                'content'       : content }
    return parsed